Додати до Chrome
✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Which of these programs can display what the user enters on the keyboard until the user enters the word: ok?
Scanner sc = new Scanner(System.in); String s = ""; while(s.compareTo("ok") == 0) { s = sc.nextLine(); System.out.println(s); }
Scanner sc = new Scanner(System.in); String s = ""; while(s.compareTo("ok") != 0) { s = sc.nextLine(); System.out.println(s); }
Scanner sc = new Scanner(System.in); String s = ""; while(sc.hasNext()) { if (s.compareTo("ok") != 0) { s = sc.nextLine(); System.out.println(s); } }
if (s.compareTo("ok") != 0)
{
s = sc.nextLine();
}
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!