Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int n,k,v[100],l=0,i;
- cin>>n>>k;
- do
- {
- v[++l]=n%10;
- n=n/10;
- }while(n>=0);
- n=v[l];
- for(i=l-k;i>=1;i--)
- {
- n=n*10+v[i];
- }
- cout<<n;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement