Promi_38

cf 977A

Dec 24th, 2020
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     int n,k;
  6.     scanf("%d %d",&n,&k);
  7.     int i;
  8.     for(i=0;i<k;i++)
  9.     {
  10.         if(n % 10 == 0) n /= 10;
  11.         else n--;
  12.     }
  13.  
  14.     printf("%d\n", n);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment