import java.util.Scanner;
public class Luck{
public static void main(String[] args){ System.out.println("請輸入您的4為會員卡號"); Scanner num = new Scanner(System.in); int number = num.nextInt(); int a = number/1000; //千位 int b = number/1000/100; //百位 int c = number/100/10; //十位 int d = number/10; //個位 int e = a+b+c+d; System.out.println(e); if(a+b+c+d>20){System.out.println("中獎");
}
else{System.out.println("沒中");
}
} }
假如我輸入了5位數(shù)怎么寫能通知出錯并且提示???