75012024-01-09 11:30:31NotYouVilágnaptár (45 pont)csharpAccepted 45/4532ms25692 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace vilagnaptar
{
    class Program
    {
        static void Main(string[] args)
        {
            int ev = 0;
            int ho = 0;
            int nap = 0;
            int[] sor = Console.ReadLine().Split().Select(int.Parse).ToArray();
            string szn = "SZN";
            string vn = "VN";
            ev = sor[0];
            ho = sor[1];
            nap = sor[2];
            int ön = 0;


            if (ev % 4 == 0)
            {
                int[] na1 = { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 };
                int[] vna1 = { 0, 31, 61, 91, 122, 152, 183, 214, 244, 274, 305, 335, 366 };
                //honap->index, +nap -> vilagnaptarba
                ön = na1[ho - 1] + nap;
                for (int i = 0; i < 12; i++)
                {
                    if (vna1[i] < ön)
                    {
                        ho = i + 1;
                    }

                }
                nap = ön - vna1[ho - 1];
                Console.Write(ev + " ");
                Console.Write(ho + " ");
                if (ho == 6 && nap == 31)
                {
                    Console.Write(szn);
                }
                else if (ho== 12 && nap == 31)
                {
                    Console.WriteLine(vn);
                }
                else
                    Console.WriteLine(nap);
                Console.ReadLine();
            }
            else
            {
                int[] na = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
                int[] vna = { 0, 31, 61, 91, 122, 152, 182, 213, 243, 273, 304, 334, 365 };
                //honap->index, +nap -> vilagnaptarba
                ön = na[ho - 1] + nap;
                for (int i = 0; i < 12; i++)
                {
                    if (vna[i] < ön)
                    {
                        ho = i + 1;
                    }

                }
                nap = ön - vna[ho - 1];
                Console.Write(ev + " ");
                Console.Write(ho + " ");
                if (ho == 12 && nap == 31)
                {
                    Console.WriteLine(vn);
                }
                else
                Console.Write(nap);
                Console.ReadLine();
            }
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/030ms22144 KiB
2Accepted0/030ms22820 KiB
3Accepted0/029ms22716 KiB
4Accepted2/229ms23272 KiB
5Accepted2/229ms23060 KiB
6Accepted3/332ms23696 KiB
7Accepted3/330ms24068 KiB
8Accepted3/330ms24088 KiB
9Accepted3/330ms24288 KiB
10Accepted3/330ms24624 KiB
11Accepted3/330ms24680 KiB
12Accepted3/330ms24636 KiB
13Accepted3/332ms24872 KiB
14Accepted3/330ms25416 KiB
15Accepted3/330ms25236 KiB
16Accepted3/332ms25372 KiB
17Accepted3/330ms25480 KiB
18Accepted2/230ms25300 KiB
19Accepted3/330ms25692 KiB