#include "stdio.h" #include "string.h" #include "ctype.h" int main() { int i,j,k; char a[1000]; while(gets(a)!=NULL) { for(i=0;i<strlen(a);i++) { int cnt=0; if(isalpha(a[i])) { for(j=i;j<strlen(a);j++) { if(isalpha(a[j]) cnt++; else break; } for(k=i+cnt-1;k>=i;k--) printf("%c",a[k]); i=i+cnt-1; } else printf("%c",a[i]); } printf("\n"); } return 0; } /* Main.c: In function 'main': Main.c:8:2: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] while(gets(a)!=NULL) ^ Main.c:19:9: error: expected ')' before 'cnt' cnt++; ^ Main.c:22:5: error: expected expression before '}' token } ^ */ |
Double click to view unformatted code.