4 solutions

  • 1
    @ 2025-7-15 14:53:56

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

    int main() { int y, m, d, s = 0; int a[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 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 = s + d; cout << s; return 0; }

    • 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; }

      • -1
        @ 2025-7-15 14:53:22

        #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; }

        • -1
          @ 2025-7-15 14:52:33

          #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 = s + d; cout << s; return 0; }

          • 1

          Information

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