在编写 "从键盘上输入某一年月,判断这年的这个月份有多少天。" 时运行时提示:(意外的类型) (需要 变量) (找到 值)
package Exam;
import java.time.Month;
import java.time.Year;
import java.util.Scanner;
public class Exam1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入某一年");
int Year = sc.nextInt();
System.out.println("请输入某一月");
int Month = sc.nextInt();
if (Year / 4 = 0 & Year / 400 = 0 & Month = 1 / 3 / 5 / 7 / 8 / 10 / 12) {
System.out.println("这年这个月有31天");
} else if (Year / 4 != 0 & Year / 400 != 0 & Month = 4 / 6 / 11) {
System.out.println("这年这个月有30天");
} else if (Year / 4 == 0 & Year / 400 == 0 & Month = 2) {
System.out.println("这年这个月有29天");
} else if (Year / 4 != 0 & Year / 400 != 0 & Month = 2) {
System.out.println("这年这个月有28天");
} else {
System.out.println("请输入正确的年月份");
}
}
}
无法运行,报错 (意外的类型) (需要 变量) (找到 值)
想要正常运行应该怎么改??
(新手入门)