?? date.java
字號:
class Date
{
int year,month,day;
Date(int year,int month,int day)
{
this.year=year;
this.month=(month-1)%12+1;
switch(this.month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:this.day=(day-1)%31+1;break;
case 4:
case 6:
case 9:
case 11:this.day=(day-1)%30+1;break;
default:
if(((year%4==0)&&(year%100!=0))||(year%400==0))
{this.day=(day-1)%29+1;}
else{this.day=(day-1)%28+1;}
}
}
public String toString()
{return year+"-"+month+"-"+day;}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -