Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <string.h>
- #include <cstdlib>
- #include <sstream> // std::stringstream
- using namespace std;
- string input = "123";
- string output;
- int main()
- {
- getline(cin, input);
- int sizeOfInput = input.size();
- char arrayOutput[sizeOfInput] = {};
- int j =0;
- for(int i = sizeOfInput-1; i>=0; i--)
- {
- arrayOutput[j] = input[i];
- j++;
- }
- for(int i = 0; i<= sizeOfInput; i++)
- {
- cout << arrayOutput[i];
- }
- cout << output << endl;
- }
Add Comment
Please, Sign In to add comment