所以我自己的有效日期只有從1520年到3999和即時新的本網站和即時新的java 請幫助 我想知道我做了什麼此代碼中出現錯誤或做什麼。如何請求用戶輸入每次無效輸入
int x;
Scanner in = new Scanner (System.in);
do
{
System.out.print ("Enter a date ");
x = in.nextInt();
}
while (x<1520&&x>3999);
{
System.out.println ("Invalid Gregorian Calendar date.");
System.out.print ("Please Input a valid Gregorian Calendar date: ");
}
}}
你忘了在'while'條件之後移除';'。 – ajp15243