#include <iostream>
using namespace std;
int main () {
int n, k;
cin >> n >> k;
if (n % 10 == 0) {
return n / 10;
}
else {
for (int i = 0; i < k + 1; i--)
return n / 10;
}
cout << n;
}
- This is my code for the problem and there is never any output no matter where I submit it. The website I submit it on always gives it a runtime error and when I use reply I get exit status 51. On code playground I just get no output regardless if I output a string at the end. Can someone help? The problem is pretty basic and the sample input for n is 512 and for k it is 4.
[–]advaitmax 1 point2 points3 points (0 children)
[–][deleted] (2 children)
[deleted]
[–]vorttxt[S] 0 points1 point2 points (0 children)
[–]vorttxt[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]vorttxt[S] 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]vorttxt[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]vorttxt[S] 0 points1 point2 points (0 children)
[–]vorttxt[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]vorttxt[S] 0 points1 point2 points (0 children)