第4测试点WA的我……

P1914 小书童——凯撒密码

已注销FYgng7CSwZb6 @ 2019-05-03 18:35:03

include<bits/stdc++.h>

using namespace std; char zzz[1]; int main() { int n; char a[100]; scanf("%d",&n); gets(zzz); gets(a); n=n%26; for(int i=0;i<strlen(a);i++) { a[i]=a[i]+n; while(a[i]>'z') a[i]=a[i]-26; } for(int i=0;i<strlen(a);i++) printf("%c",a[i]); printf("\n"); return 0; }


by Smile_Cindy @ 2019-05-03 18:36:42

@zuozug_345345345

希望更丰富的展现?使用Markdown


by 已注销FYgng7CSwZb6 @ 2019-05-03 18:37:05

include<bits/stdc++.h>

using namespace std;

char zzz[1];

int main()

{

int n;

char a[100];

scanf("%d",&n);

gets(zzz);

gets(a);

n=n%26;

for

(int i=0;i<strlen(a);i++)

{

a[i]=a[i]+n;

while(a[i]>'z')

a[i]=a[i]-26;

}

for(int i=0;i<strlen(a);i++)

printf("%c",a[i]);

printf("\n");

return 0;

}


by 已注销FYgng7CSwZb6 @ 2019-05-03 18:38:52

及:MARKDOWN怎么用。。。


by aminoas @ 2019-05-03 18:39:00

#include<bits/stdc++.h>
using namespace std;

char zzz[1];

int main()

{

int n;

char a[100];

scanf("%d",&n);

gets(zzz);

gets(a);

n=n%26;

for

(int i=0;i<strlen(a);i++)

{

a[i]=a[i]+n;

while(a[i]>'z')

a[i]=a[i]-26;

}

for(int i=0;i<strlen(a);i++)

printf("%c",a[i]);

printf("\n");

return 0;
}

@zuozug_345345345


|