Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int rotire(int n)
- {
- int p=100, m, pr, nr_nou;
- m=n;
- while(n>9)
- {
- n=n/10;
- }
- pr=n;
- nr_nou=(m%10)*10+pr;
- m/=10;
- while(m!=0)
- {
- nr_nou=(m%10)*p+nr_nou;
- p=p*10;
- m/10;
- }
- return nr_nou;
- }
- int main()
- {
- int n;
- cin>>n;
- cout<<rotire(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement