Skip to content

Commit e05d011

Browse files
committed
Wrong Subtraction
1 parent 57adbd0 commit e05d011

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

977A.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include<iostream>
2+
using namespace std;
3+
4+
int main(){
5+
int n, k;
6+
cin>>n;
7+
cin>>k;
8+
9+
for(int i = 0; i < k; i++){
10+
if(n%10 == 0){
11+
n /= 10;
12+
}
13+
else{
14+
n--;
15+
}
16+
}
17+
cout<<n;
18+
}

0 commit comments

Comments
 (0)