Advertisement
SelinD

114?

May 23rd, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,k,v[100],l=0,i;
  6. cin>>n>>k;
  7.  
  8. do
  9. {
  10. v[++l]=n%10;
  11. n=n/10;
  12. }while(n>=0);
  13. n=v[l];
  14. for(i=l-k;i>=1;i--)
  15. {
  16. n=n*10+v[i];
  17. }
  18.  
  19. cout<<n;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement