求助,error看不懂......
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 8;
int day = 8;
int today=0;
/*
* 请使用switch语句,if...else语句完成本题
* 如有想看小编思路的,可以点击左侧任务中的“不会了怎么办”
* 小编还是希望大家独立完成哦~
*/
if(year%4==0)
{
switch(month)
{
case 12:today+=30;
case 11:today+=29;
case 10:today+=30;
case 9:today+=29;
case 8:today+=30;
case 7:today+=30;
case 6:today+=29;
case 5:today+=30;
case 4:today+=29;
case 3:today+=30;
case 2:today+=29;
case 1:today+=day;
break;
printf("今日是%d年的第%d天",year,today);
}
else
{
switch(month)
{
case 12:today+=30;
case 11:today+=29;
case 10:today+=30;
case 9:today+=29;
case 8:today+=30;
case 7:today+=30;
case 6:today+=29;
case 5:today+=30;
case 4:today+=29;
case 3:today+=30;
case 2:today+=28;
case 1:today+=day;
break;
printf("今日是%d年的第%d天",year,today);
}
}
}
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 8;
int day = 8;
/*
* 请使用switch语句,if...else语句完成本题
* 如有想看小编思路的,可以点击左侧任务中的“不会了怎么办”
* 小编还是希望大家独立完成哦~
*/
return 0;
}