73522024-01-08 09:39:05szabelrVilágnaptár (45 pont)cpp17Hibás válasz 39/453ms3808 KiB
#include <iostream>
using namespace std;
int main()
{
    int ev, honap, nap;
    cin >> ev >> honap >> nap;
    if (ev % 4 != 0)
    {
        if (honap == 1 or honap == 9 or honap == 10 or honap == 11 or honap == 2)
            cout << ev << " " << honap << " " << nap;
        if (honap == 12 and nap < 31)
            cout << ev << " " << honap << " " << nap;
        if (honap == 12 and nap == 31)
            cout << ev << " " << honap << " " << "VN";
        if (honap == 3 and nap <= 2)
            cout << ev << " " << honap - 1 << " " << 28 + nap;
        if (honap == 3 and nap > 2)
            cout << ev << " " << honap << " " << nap - 2;
        if (honap == 4 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 4 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 5 and nap <= 2)
            cout << ev << " " << honap - 1 << " " << 29 + nap;
        if (honap == 5 and nap > 2)
            cout << ev << " " << honap << " " << nap - 2;
        if (honap == 6 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 6 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 7 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "30";
        if (honap == 7 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 8 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 8 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
    }
    if (ev % 4 == 0)
    {
        if (honap == 1 or honap == 9 or honap == 10 or honap == 11 or honap == 2)
            cout << ev << " " << honap << " " << nap;
        if (honap == 12 and nap < 31)
            cout << ev << " " << honap << " " << nap;
        if (honap == 12 and nap == 31)
            cout << ev << " " << honap << " " << "VN";
        if (honap == 3 and nap <= 1)
            cout << ev << " " << honap - 1 << " " << 29 + nap;
        if (honap == 3 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 4 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 4 and nap > 1)
            cout << ev << " " << honap << " " << nap ;
        if (honap == 5 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 5 and nap >= 2)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 6 and nap >= 1)
            cout << ev << " " << honap << " " << nap ;
        if (honap == 7 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "SZN";
        if (honap == 7 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 8 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 8 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
    }
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base39/45
1Elfogadva0/03ms1744 KiB
2Elfogadva0/03ms1908 KiB
3Elfogadva0/03ms2272 KiB
4Elfogadva2/23ms2324 KiB
5Elfogadva2/23ms2572 KiB
6Elfogadva3/33ms2656 KiB
7Elfogadva3/33ms2720 KiB
8Elfogadva3/33ms2928 KiB
9Elfogadva3/33ms3140 KiB
10Elfogadva3/33ms3220 KiB
11Elfogadva3/33ms3236 KiB
12Elfogadva3/33ms3348 KiB
13Elfogadva3/33ms3600 KiB
14Elfogadva3/33ms3568 KiB
15Elfogadva3/33ms3680 KiB
16Elfogadva3/33ms3692 KiB
17Hibás válasz0/33ms3772 KiB
18Elfogadva2/23ms3808 KiB
19Hibás válasz0/33ms3776 KiB