#include #include using namespace std; int main() { string str; string store [100]; int i = 0; cout<<"Enter a string:
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
#include #include using namespace std; int main() { string str; string store [100]; int i = 0; cout<<"Enter a string:
#include #include using namespace std; int main() { string str; string store [100]; int i = 0; cout<<"Enter a string: \n"; while (1) { getline (cin, str); if(str == "STOP")
if(str == "STOP") { break; } else { store = str; i++; } } cout << "String list generated in reverse: \n"; for (int j =i- 1; j>=0; j--) { cout << store [j] << endl; }
} cout << "String list generated in reverse: \n"; for (int j =i- 1; j>=0; j--) { cout << store [j] << endl; } return 0;