fork download
  1. #include<iostream>
  2. #include<fstream>
  3. #include<string>
  4. using namespace std;
  5. int main()
  6. {
  7. #ifndef ONLINE_JUDGE
  8. freopen("input.txt", "r", stdin);
  9. freopen("output.txt", "w", stdout);
  10. #endif
  11. int i, j, k, start, end;
  12. char c;
  13. string str;
  14.  
  15. while(!cin.eof()){
  16. getline(cin, str);
  17. for(start=0, i=0 ; i<str.size() ; i++){
  18. while(str[i]!=' ' && i!=str.size()){i++;}
  19. end = i-1;
  20. while(start<=end){
  21. cout << str[end];
  22. end--;
  23. }
  24. start = i+1;
  25. if(start!=str.size()) cout << " ";
  26. }
  27. cout << endl;
  28. }
  29. return 0;
  30. }
  31.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty