struggle forever
#include<stdio.h> #include<string.h> int main() { char ch; char arr[1000]; int i=0,j,k,l; while(scanf("%c",&ch)==1) { if(ch==' '||ch=='\n') { for(j=i-1;j>=0;j--) { printf("%c",arr[j]); } i=0; printf("%c",ch); } else { arr[i++]=ch; } } return 0; }
No comments:
Post a Comment