Files
python/C++课程/第十七课一维数组/p188.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

19 lines
328 B
C++

#include<bits/stdc++.h>
using namespace std;
int year,month,date,ans;
int main() {
int a[13]= {0,31,28,31,30,31,30,31,31,30,31,30,31};
cin>>year>>month>>date;
for(int i=1; i<month; i++)
ans+=a[i];
ans+=date;
if(year%4==0 and year%100!=0 or year%400==0)
if(month>2) ans++;
cout<<ans;
return 0;
}