1 solutions
-
0
C++ :
#include<iostream> using namespace std; struct date{ int year,month,day; }; date a; int days(date a) { int b[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int ans=a.day; for (int i=1; i<a.month; i++) ans+=b[i]; if (a.year%4==0 && a.year%100!=0 || a.year%400==0) ans++; return ans; } int main() { cin>>a.year>>a.month>>a.day; cout<<days(a)<<endl; return 0; }
- 1
Information
- ID
- 16746
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By