我收到else without if
错误。谁能告诉我这是什么问题?
import java.util.Scanner;
class Atm {
public static void main(String[] args) {
int expin = 1234;
int bal = 25000;
int enpin, amt;
System.out.println("WELCOME TO VV BANK");
System.out.println("ENTER THE PIN");
Scanner scn = new Scanner(System.in);
enpin = scn.nextInt();
if (enpin == expin) {
System.out.println("ENTER THE AMOUNT");
amt = scn.nextInt();
if (amt < bal) {
bal = bal - amt;
System.out.println("The new balance is" + bal);
} else {
System.out.println("insufficient balance");
}
} else {
System.out.println("Invalid pin");
}
System.out.println("Thank u for using ATM");
}
}