0_0_31907217_219.cpp: In function 'int main()':
0_0_31907217_219.cpp:2:64: error: expected '}' at end of input
int main() { int day[12] = {31,0,31,30,31,30,31,31,30,31,30,31}; //每个月份各有多少天。由于2月不确定,所以暂且设为0 int year, month, date; int total = 0; //天数 while(scanf("%d/%d/%d", &year, &month, &date) != EOF) { if((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))) { //判断输入年份是否是闰年,然后设置二月天数 day[1] = 29; } else { day[1] = 28; } int i = 0; //月份计数 while(i < month - 1) { total += day[i]; i++; } total += date; printf("%d\n",total); total = 0; } return 0;}
^
|