0
I have been searching the whole f.day where is my mistake and finally i just realize its the > sign i just make it x >=3 . Omg
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 x; int y = 0; int z = 0; for(x = 1; x <= 3; x++){ y = amount / 10; z = amount - y; amount = z; } System.out.println(amount); } }
1 Antwort
+ 6
It's okay to make mistakes, it's part of learning. No mistake is only possible with no try.
But maybe next time you may use the Feeds for personal notifications 👌