Advertisement
Guest User

3. zadatak

a guest
Apr 2nd, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main()
  5. {
  6.     int broj;
  7.     cout << "Unesi broj: ";
  8.     cin >> broj;
  9.     while (broj<1)
  10.     {
  11.         cout << "Unesi ponovno: ";
  12.         cin >> broj;
  13.     }
  14.     string s = to_string(broj);
  15.     reverse(begin(s), end(s));
  16.      broj = stoi(s);
  17.     cout << broj << endl;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement