完了,红题都只能得60(#3#4)
查看原帖
完了,红题都只能得60(#3#4)
1481182
He268435456楼主2025/1/29 20:51

下载测试点#3后 标准输入

26
qwertyuiopasdfghjklzxcvbnm

标准输出

qwertyuiopasdfghjklzxcvbnm

我的输出

媤ertyuiopasdfghjklzxcvbnm

#include <iostream>
#include <cstring>
using namespace std;

int main() {
	char a[101];
	long long unsigned int b, c;
	cin >> b >> a;
	for (long long unsigned int i = 0; i < strlen(a); i++) {
		if (c + b <= 122) {
			c = a[i];
			c += b;
			a[i] = c;
		} else {
			c = a[i];
			c += b;
			c -= 26;
			a[i] = c;
		}
	}
	for (long long unsigned int i = 0; i < strlen(a); i++) {
		cout << a[i];
	}
}
2025/1/29 20:51
加载中...