3、4点错了
查看原帖
3、4点错了
284066
BensonQAQ楼主2020/10/11 13:56
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
  int n;
  string s;
  cin>>n>>s;
  for(int i=0;i<s.size();i++)
  {
    s[i]+=n;
    while(s[i]>122)
      s[i]-=26;
  }
  cout<<s;
  return 0;
} 

3号点

in

26 qwertyuiopasdfghjklzxcvbnm

out

qwertyuiopasdfghjklzxcvbnm

我的计算过程

26 q=113

113+26=139(s[i]>122)-26=113

2020/10/11 13:56
加载中...