#include<stdio.h> #include<string.h> int main() { char a[1000]; int len; while(gets(a)){ len=strlen(a); for(i=len-1;i>=0;i--) printf("%c",a[i]); } printf("\n"); return 0; } /* Main.c: In function 'main': Main.c:7:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] while(gets(a)){ ^ Main.c:9:11: error: 'i' undeclared (first use in this function) for(i=len-1;i>=0;i--) ^ Main.c:9:11: note: each undeclared identifier is reported only once for each function it appears in */ |
Double click to view unformatted code.