I have a problem.
  • 板块学术版
  • 楼主_5555_
  • 当前回复25
  • 已保存回复25
  • 发布时间2022/8/4 19:53
  • 上次更新2023/10/27 17:00:27
查看原帖
I have a problem.
722330
_5555_楼主2022/8/4 19:53

Why is this code compiled error?

There is no problem with local compilation, but why do compilation errors occur after submission?

#include<bits/stdc++.h>

using namespace std;

int main()
{
	string s;
	int k;
	cin >> s >> k;
	int l=s.length();
	for (int i=0;i<l;i++)
		cout << char((s[i]+k-65)%26+65);
	cout << endl;
	return 0; 
}
2022/8/4 19:53
加载中...