4 solutions
-
-1
#include <bits/stdc++.h> using namespace std;
int a[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() { int y, m, d, s = 0; cin >> y >> m >> d; if (y % 400 == 0 || y % 4 == 0 && y % 100) { a[2]++; } for (int i = 1; i < m; i++) { s = s + a[i]; } s += d; cout << s; return 0; }
Information
- ID
- 339
- Time
- 1000ms
- Memory
- 64MiB
- Difficulty
- 6
- Tags
- # Submissions
- 135
- Accepted
- 39
- Uploaded By