题解 | #今年的第几天?#
今年的第几天?
https://www.nowcoder.com/practice/ae7e58fe24b14d1386e13e7d70eaf04d
#include <stdio.h> int main() { int a, b,c; int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; while (scanf("%d %d %d", &a,&b,&c) != EOF) { if (a%4==0&&a%100!=0||a%400==0) { month[2]=29; } int sum=0; for (int i=1; i<b; i++) { sum+=month[i]; } sum+=c; printf("%d\n",sum); } return 0; }