#include<stdio.h>
int main()
{
char s[100];
while(gets(s))
{
for(int i=0;s[i]!='\0';i++)
s[i]-=7;
puts(s);
}
return 0;
int main()
{
char s[100];
while(gets(s))
{
for(int i=0;s[i]!='\0';i++)
s[i]-=7;
puts(s);
}
return 0;
}
此题可以自行写个译码函数,寻找规律:
#include <stdio.h> int main(void) { char s1[] = "1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu5"; char s2[] = "*CDC is the trademark of the Control Data Corporation."; int i = 0; while(s1[i] != '\0') { printf("%4d%4d\n", s1[i], s2[i]); i++; } return 0; }