package com.wf.bean;
import java.util.Scanner;
public class TestMethod {
/**
* @param args
*/
public static void main(String[] args) {
for (int i = 0; i < 3; i++) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入您的账号:");
String userName = sc.nextLine();
System.out.println("请输入您的密码:");
String password = sc.nextLine();
if ("wflo".equals(userName) && "vethm".equals(password)) {
System.out.println("欢迎 " + userName+password + "登录");
break;
} else if (i == 2) {
System.out.println("您的賬號被鎖,請您去服務台解鎖,然後登錄");
} else {
System.out.println("您還有" + (2 - i) + "次機會");
}
}
}
}
|
|