'commit'
This commit is contained in:
18
C++课程/第十七课一维数组/p188.cpp
Normal file
18
C++课程/第十七课一维数组/p188.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user