+ 3
Help me to understand (Помогите разобраться)
payment is considered incorrect (Неверно считается платёж). https://code.sololearn.com/c42lZ6vs3Z2i/?ref=app
3 Answers
+ 1
You should update the payment, too (in each iteration):
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int amount = scanner.nextInt();
for (int i = 1; i < 4; i++){
int payment = amount/10;
amount = amount - payment;
}
System.out.println(amount);
}
}
+ 1
Thanks.
the first test passes, but on the second test there is an error. fixed the code
0
Jzxn9