Advertisement
erfanul007

UVa 483

Nov 4th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5. char a[1000],temp;
  6. int n,i,j,k;
  7. while(scanf("%[^\n]",a)!=EOF){
  8. getchar();
  9. i=0;
  10. j=0;
  11. n=strlen(a);
  12. while(1){
  13. while(1){
  14. if(a[i]==' ' || a[i]=='\0')
  15. break;
  16. i++;
  17. }
  18. for(k=i-1;k>=j;k--)
  19. printf("%c",a[k]);
  20. if(i==n)
  21. break;
  22. printf(" ");
  23. i++;
  24. j=i;
  25.  
  26. }
  27. printf("\n");
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement