2020-10-20

it2023-07-17  81

练习四-1005(求天数)

两种 1.能通过oj: 2.不能通过oj: #include<stdio.h>

int main() { int mouth ,year,day=31;

while(scanf("%d %d",&year,&mouth)!=EOF){ if(year>0&&mouth<=12){ if( mouth4|| mouth6||mouth9||mouth11){ day=30; } if( mouth2){ day=28+(year%40&&year%100!=0||year%400==0); } printf("%d\n",day);

} else printf(“ERROR\n”); } return 0; }

最新回复(0)