SHARE
TWEET

Untitled

a guest Jan 28th, 2020 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7.     setlocale(LC_ALL, "Russian");
  8.     int num;
  9.     cout << "Введите число:" << endl;
  10.     cin >> num;
  11.  
  12.     string str = to_string(num);;
  13.     swap(str[0], str[str.size() - 1]);
  14.     num = stoi(str);
  15.  
  16.     cout << num << endl;
  17.     system("pause");
  18.     return 0;
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top