Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int num;
- cout << "Введите число:" << endl;
- cin >> num;
- string str = to_string(num);;
- swap(str[0], str[str.size() - 1]);
- num = stoi(str);
- cout << num << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement