package For循环开始;
import java.util.Scanner;
public class 登录系统输入密码 {
public static void main(String[] args) {
int a = 9747;
int b = 97476;
int q = 0;
Scanner input = new Scanner(System.in);
do {
System.out.print(“输入你的账号:”);
int x = input.nextInt();
System.out.print(“输入你的密码:”);
int y = input.nextInt();
q += 1;
if (x == a && y == b){
System.out.println(“正确,进入系统”);
break;
}else{
System.out.println(“错误还有”+(3-q)+“次机会”);
}
} while (q < 3);
if (q >= 3) {
System.out.println(“对不起,3次全错误”);
}
}
}