0
I can't get the output correctly, here in the 1st line in the for loop.this rem=amount*(10/100); and rem=(amount*10)/100;no same
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); //your code goes here int rem; for(int i=0;i<3;i++) { rem=amount*(10/100); amount =amount-rem; } System .out.println(amount); } }
4 ответов
+ 1
https://www.sololearn.com/discuss/2680282/?ref=app
https://www.sololearn.com/discuss/2660363/?ref=app
https://www.sololearn.com/discuss/2657212/?ref=app
https://www.sololearn.com/discuss/2623613/?ref=app
https://www.sololearn.com/discuss/2651293/?ref=app
https://www.sololearn.com/discuss/2747169/?ref=app
https://www.sololearn.com/discuss/2610459/?ref=app
+ 1
Hope this helps you
+ 1
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 mouth = 0; mouth < 3; mouth++){
amount = amount - (amount / 10);
}
System.out.println(amount);
}
}
//Indeed this are the changes you should bring in your code
0
Thank you