Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int broj;
- cout << "Unesi broj: ";
- cin >> broj;
- while (broj<1)
- {
- cout << "Unesi ponovno: ";
- cin >> broj;
- }
- string s = to_string(broj);
- reverse(begin(s), end(s));
- broj = stoi(s);
- cout << broj << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement