谁能告诉我,这道题错误的问题所在?
我觉得没有毛病啊,然后还看了问号,找不到问题的所在啊!
我觉得没有毛病啊,然后还看了问号,找不到问题的所在啊!
2021-04-10
#include<stdio.h>int main() { int year = 2008; int month = 8; int day = 8; int i; int d; int days = 0; for (i = 1; i < month; i++) { switch (i) { 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; case 2:if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) d = 29; else d = 28; } days += d; } printf("%d年%d月%d日是该年的第%d天", year, month, day, days + day); return 0;}
网页 成功运行,答案221天。
网页没问题,错误提示少个int
int main(){...}
举报