reversing a combination of int and character

dear senior programmers can you help me with a programm that has a single user input that will reverse both the character and number

for example
123abc

output
cba321

1
2
3
4
5
6
7
8
9
10
11
#include <algorithm>
#include <iostream>
#include <string>

int main()
{
    std::string input;
    std::cin >> input;
    std::reverse(input.begin(), input.end());
    std::cout << input;
}
123abc
cba321
http://coliru.stacked-crooked.com/a/770941dc20786c67
Last edited on
Thank you so much
Topic archived. No new replies allowed.