package com.itheima;
import java.util.Scanner;
public class XinRenBaoDao {
public static void main(String[] args) {
System.out.println("\t"+" 欢迎来到黑马");
System.out.println("\t"+"欢迎来到Java世界");
Scanner sc = new Scanner(System.in);
System.out.print("请输入“新人报道”:");
String s = sc.next();
while (true) {
if (!s.equals("新人报道")) {
System.out.print("输入有误,请重新输入:");
s = sc.next();
} else {
System.out.println("报道成功");
break;
}
}
sc = new Scanner(System.in);
System.out.print("请输入“签到”:");
String ss = sc.next();
while (true) {
if (!ss.equals("签到")) {
System.out.print("输入有误,请重新输入:");
ss = sc.next();
} else {
System.out.println("签到成功");
System.out.println("小手一抖,经验到手");
break;
}
}
}
} |
|