#include <stdio.h>
typedef struct Zero
{
int years; //年
int month; //月
int day; //日
int i;
}zero;
int main()
{
zero a, b, c, n;
n.i = 0;
scanf_s("%d %d %d", &a.years, &b.month, &c.day);
switch (b.month)
{
case 1:
n.i = 0;
break;
case 2:
n.i = 59 - 28;
break;
case 3:
n.i = 90 - 31;
break;
case 4:
n.i = 120 - 30;
break;
case 5:
n.i = 151 - 31;
break;
case 6:
n.i = 181 - 30;
break;
case 7:
n.i = 212 - 31;
break;
case 8:
n.i = 243 - 31;
break;
case 9:
n.i = 273 - 30;
break;
case 10:
n.i = 304 - 31;
break;
case 11:
n.i = 334 - 30;
break;
case 12:
n.i = 365 - 31;
break;
default:
printf("无效\n");
}
if ((a.years % 4 == 0 && a.years % 100 != 0) || a.years % 400 == 0)
n.i += 1;
n.i += c.day;
printf("%d\n", n.i);
return 0;
}
0.0分
0 人评分
简洁的代码浏览:1474 |
C语言程序设计教程(第三版)课后习题6.11 (C++代码)(有个库函数叫sqrt)浏览:981 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:511 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:658 |
【亲和数】 (C语言代码)浏览:908 |
字符串对比 (C语言代码)浏览:1471 |
A+B for Input-Output Practice (II) (C语言代码)浏览:1043 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:1215 |
WU-蓝桥杯算法提高VIP-企业奖金发放 (C++代码)浏览:1267 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:761 |