循环语句嵌套判断
程序员文章站
2022-03-21 09:02:11
...
import java.util.*;
public class Demo10{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.println("请输入账号");
int a = input.nextInt();
System.out.println("请输入密码");
int b = input.nextInt();
if(a==1234){
if(b==12345){
System.out.println("登录成功");
}else{
System.out.println("密码不正确");
}
}else{
System.out.println("账号不正确");
}
}