134942025-01-08 08:45:38Leventusz09Világnaptár (45 pont)cpp17Wrong answer 22/451ms508 KiB
#include <iostream>

using namespace std;

int main() {
	int Év, Hó, Nap;
	cin >> Év >> Hó >> Nap;
	bool Sz = (Év % 4 == 0);

	int hs[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int  h[12] = {31, 30, 30, 31, 30, 30, 31, 30, 30, 31, 30, 30};

	if (Hó == 12 && Nap == 31) {
		cout << Év << " 12 VN\n";
		return 0;
	}
	int n = Nap;
	for (int i = 1; i < Hó; i++) n += hs[i - 1];
	if(Hó>=3) n += Sz;

	int oh = 1;
	while(n > 31){
		n -= h[Hó - oh];
		oh++;
	}
	if (oh == 6 && n == 31) cout << Év << " 6 SZN\n";
	else cout << Év << " " << oh << " " << n << endl;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base22/45
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted0/01ms316 KiB
4Wrong answer0/21ms500 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/31ms316 KiB
7Wrong answer0/31ms316 KiB
8Accepted3/31ms500 KiB
9Accepted3/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Accepted3/31ms328 KiB
12Wrong answer0/31ms508 KiB
13Accepted3/31ms316 KiB
14Wrong answer0/31ms316 KiB
15Wrong answer0/31ms316 KiB
16Accepted3/31ms316 KiB
17Accepted3/31ms316 KiB
18Accepted2/21ms316 KiB
19Wrong answer0/31ms508 KiB