1234567891011121314151617181920212223 |
- /**
- * Created by iyasuwatts on 10/17/17.
- */
- import java.util.Scanner;
- public class Main {
-
- public static void main(String[] args ){
- Scanner scanner = new Scanner(System.in);
-
- while (true) {
-
- System.out.println("What is your name?");
- String name = scanner.nextLine();
- if (name.equals("Alice") || name.equals("Bob")) {
- System.out.println("Hello " + name + "!");
- break;
- } else {
- System.out.println("You're not Alice or Bob!");
- }
- }
- }
- }
|