-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreverseAword_STL.cpp
More file actions
57 lines (38 loc) · 808 Bytes
/
reverseAword_STL.cpp
File metadata and controls
57 lines (38 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*#include<iostream>
#include <vector>
using namespace std;
int main(){
string inp;
std::vector<string> final;
while(cin.get()!='\n'){
cin>>inp;
final.push_back(inp);
}
std::vector<string>::reverse_iterator it;
for(it=final.rbegin();it!=final.rend();it++){
cout<<*it<<'\t';
}
return 0;
}*/
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include <cstdlib> // system("Pause")
using namespace std;
int main()
{
string inp;
vector<string> final;
while(cin.get()!='\n')
{
cin>>inp;
final.push_back(inp);
}
vector<string>::reverse_iterator ii;
for(ii=final.rbegin();ii!=final.rend();++ii)
cout<<*ii<<"\t";
//system("PAUSE");
return 0;
}