Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- using namespace std;
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- int main()
- {
- string S;
- int j=0;
- getline(cin, S);
- string temp[40];
- for (int i=0; i<S.length(); i++){
- if (S[i]==' '){
- j++;
- continue;
- }
- temp[j]+=S[i];
- }
- for (int i=j; i>=0; i--){
- cout<<temp[i];
- if (i!=0) cout<<" ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement