0

Java логические операторы

Сделал код, знакомый который разбирается говорит, что все правильно, но в итоге мне выдаёт ошибки мол у меня не выставлены ; А куда их там ставить, если там везде {} https://code.sololearn.com/cbPSrkTGEHTB/?ref=app

15th Apr 2021, 9:18 AM
Wyns
Wyns - avatar
3 Answers
+ 4
Not sure what you are looking for. May be something similar you were trying. if (number == 10 || number == 9){ System.out.println("You won $200"); } else if (number == 4 || number == 6){ System.out.println("You won $50"); } else { System.out.println("Try again"); }
15th Apr 2021, 10:00 AM
Avinesh
Avinesh - avatar
+ 1
Thank you all import java.util.Scanner ; public class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); int number = read.nextInt(); //ваш код if (number %10 == 0 && number %9 == 0 ) { System.out.println("You won $200") ; } else if (number %4 == 0 || number %6 == 0 ) { System.out.println("You won $50") ; } else { System.out.println("Try again") ; } } }
16th Apr 2021, 1:29 PM
Wyns
Wyns - avatar
15th Apr 2021, 10:00 AM
Dareen Moughrabi
Dareen Moughrabi - avatar