import java.util.Scanner;
public class A03 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
for (int i = 0; i < 3; i++) {
System.out.println("请输入用户名:");
String admin = input.next();
System.out.println("请输入密码:");
String pwd = input.next();
if (!admin.equals("admin") || !pwd.equals("yanyan")) {
System.out.println("输入错误!您还有" + (i - 2) * -1 + "次机会");
continue;
}
System.out.println("欢迎登录MyShopPing系统");
return;
}
}
}
转载于:https://blog.51cto.com/765133133/1420823