📄 excise0326.java
字号:
class Excise0210{
private int year;
public void set(int y){year=y;}
public boolean isLeap(){
if(year%400==0||(year%400!=0&&year%4==0)) return true;
else return false;
}
}
class Excise0326{
static int dayInMonth(int y, int m){
int D;
Excise0210 Y=new Excise0210();
Y.set(y);
switch(m){
case 2: if(Y.isLeap()==true) D=29;else D=28; break;
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12: D=31; break;
case 4:
case 6:
case 9:
case 11: D=30; break;
default: System.out.println("Unvalid month!");D=0;
}
return D;}
public static void main(String args[]){
int day=dayInMonth(200400,2);
System.out.println("it has "+day+" days.");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -