Wrong Answer
/in/foo.c: In function 'main': /in/foo.c:5:9: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[50]' [-Wformat=] scanf("%s",&s); ^
代码
#include<stdio.h>
#define max 50
int main(){
char s[max],d[max];
scanf("%s",&s);
int i = 0;
while(s[i]!='\0'){
int r = (s[i] + 4 - ('a' - 1))%26;
d[i] = ((s[i]>='a')?'a':'A'+6)+ r;
i++;
}
d[i] = '\0';
printf("%s",d);
return 0;
}