fork download
  1.  
  2. #include <stdio.h>
  3. #include<string.h>
  4. int main()
  5. {
  6. int i,j=0,k=0,x,len;
  7. char s[100],s1[10][20],t;
  8. scanf("%[^\n]s",s);
  9. for(i=0;s[i]!='\0';i++)
  10. {
  11. if(s[i]==' ')
  12. {
  13. s1[k][j]='\0';
  14. k++;
  15. j=0;
  16. }
  17. else
  18. {
  19. s1[k][j]=s[i];
  20. j++;
  21. }
  22. }
  23. s1[k][j]='\0';
  24. for(i=0;i<=k;i++)
  25. {
  26. len=strlen(s1[i]);
  27. for(j=0,x=len-1;j<x;j++,x--)
  28. {
  29. t=s1[i][j];
  30. s1[i][j]=s1[i][x];
  31. s1[i][x]=t;
  32. }
  33. }
  34. for(i=0;i<=k;i++)
  35. {
  36. printf("%s ",s1[i]);
  37. }
  38.  
  39.  
  40. return 0;
  41. }
Success #stdin #stdout 0s 9424KB
stdin
he is
stdout
eh si