#include <stdio.h> #include <string.h> int main(){ char a[100]; int i,n,m,k; while (gets(a)){ for(i=0;i<strlen(a);i++){ while (((a[i]>'a'$$a[i]<'z')||(a[i]>'A'&&a[i]<'Z')) == 0) i++; m=i; while((a[i]>'a'&&a[i]<'z' || a[i]>'A'&&a[i]<'Z')) i++; n=i-1; for(k=0,j=m;j<=(m+n)/2;j++,k++){ t=a[j]; a[j]=a[n-k]; a[n-k]=t; } } puts(a); } return 0; } /* Main.c: In function 'main': Main.c:6:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] while (gets(a)){ ^ Main.c:8:24: error: expected ')' before '$$a' while (((a[i]>'a'$$a[i]<'z')||(a[i]>'A'&&a[i]<'Z')) == 0) ^ Main.c:11:22: warning: suggest parentheses around '&&' within '||' [-Wparentheses] while((a[i]>'a'&&a[i]<'z' || a[i]>'A'&&a[i]<'Z')) ^ Main.c:14:15: error: 'j' undeclared (first use in this function) for(k=0,j=m;j<=(m+n)/2;j++,k++){ ^ Main.c:14:15: note: each undeclared identifier is reported only once for each function it appears in Main.c:14:33: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(k=0,j=m;j<=(m+n)/2;j++,k++){ ^ Main.c:15:9: error: 't' undeclared (first use in this function) t=a[j]; ^ */ |
Double click to view unformatted code.