error C2196: case 值“1”已使用
#include <stdafx.h>
int main()
{
int year = 2008, month = 8, day = 8, b = 0;
for (; 1 <= month; month--)
{
switch (month)
{
case 1 || 3 || 5 || 7 || 8 || 10 || 12:
b = b + 31;
break;
case 2:
if (year % 4 == 0 && year % 100 !=0 || year % 400 == 0)
b = b + 29;
else
b = b + 28;
break;
case 4||6||9||11:
b = b + 30;
break;
}
}
printf("%d", b + day);
return 0;
}