4 solutions

  • 0
    @ 2025-7-15 14:51:24

    #include <bits/stdc++.h> using namespace std;

    int days[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    int main() { int y, m, d, h = 0; cin >> y >> m >> d; if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) { days[2]++; } for (int i = 1; i < m; i++) { h = h + days[i]; } h = h + d; cout << h; return 0; }

    Information

    ID
    339
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    6
    Tags
    # Submissions
    135
    Accepted
    39
    Uploaded By