Code
#include <stdio.h>
int main()
{
char s[6];
int i;
gets(s);
for(i=0; i<5; i++)
s[i] = s[i] + 4;
printf("password is %s",s);
return 0;
}
反思:字符串练习,因为不含w、x、y、z,直接将每位字符的ASCII码后移4位即可。
#include <stdio.h>
int main()
{
char s[6];
int i;
gets(s);
for(i=0; i<5; i++)
s[i] = s[i] + 4;
printf("password is %s",s);
return 0;
}
反思:字符串练习,因为不含w、x、y、z,直接将每位字符的ASCII码后移4位即可。