Too short on line 1,求大佬救救蒟蒻
查看原帖
Too short on line 1,求大佬救救蒟蒻
290054
逆袭疾风楼主2020/4/27 17:04
#include<iostream>
#include<string>
#include<cstdio>
using namespace std;
int main()
{
	string password;
	string newpass;
	int n;
	cin >> n; getchar();
	getline(cin, password);
for (int i = 0; i < password.size(); i++) {
	for (int j = 0; j < n; j++) {
	if (password[i] < 'z') password[i]++;
      if(password[i]=='z') password[i] = password[i]-25;
		}
	}
	newpass = password;
	cout << newpass;
	return 0;
}

ps:getchar加不加都报错

2020/4/27 17:04
加载中...