#include<stdio.h> #include<string.h> int main() { char str[100],t; gets(str); int l=strlen(str); for(int i=0;i<l;i++) { t=a[i]; a[i]=a[l-i-1]; a[l-i-1]=t; } puts(str); return 0; } /* Main.c: In function 'main': Main.c:6:4: warning: 'gets' is deprecated [-Wdeprecated-declarations] gets(str); ^~~~ In file included from Main.c:1: /usr/include/stdio.h:583:14: note: declared here extern char *gets (char *__s) __wur __attribute_deprecated__; ^~~~ Main.c:10:12: error: 'a' undeclared (first use in this function) t=a[i]; ^ Main.c:10:12: note: each undeclared identifier is reported only once for each function it appears in */ |
Double click to view unformatted code.