Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Írd be az évet !");
- int ev = int.Parse(Console.ReadLine());
- int[] honapok = new int[13];
- honapok[0]=29;
- honapok[1]=31;
- honapok[2]=28;
- honapok[3]=31;
- honapok[4]=30;
- honapok[5]=31;
- honapok[6]=30;
- honapok[7]=31;
- honapok[8]=31;
- honapok[9]=30;
- honapok[10]=31;
- honapok[11]=30;
- honapok[12]=31;
- Console.WriteLine("Írd be a hónapot ! (1-12)");
- int honap = int.Parse(Console.ReadLine());
- bool bekapode = false;
- if (honap == 2)
- bekapode = true;
- if (ev % 400 == 0 || ev % 4 == 0 && ev % 100 != 0 )
- {
- if (bekapode)
- {
- Console.Write("ez a hónap ennyi napos : ");
- Console.Write(honapok[0]);
- }
- }
- else
- {
- Console.Write("ez a hónap ennyi napos : ");
- Console.Write(honapok[honap]);
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement