Advertisement
Guest User

Untitled

a guest
Sep 20th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("Írd be az évet !");
  14. int ev = int.Parse(Console.ReadLine());
  15.  
  16. int[] honapok = new int[13];
  17. honapok[0]=29;
  18. honapok[1]=31;
  19. honapok[2]=28;
  20. honapok[3]=31;
  21. honapok[4]=30;
  22. honapok[5]=31;
  23. honapok[6]=30;
  24. honapok[7]=31;
  25. honapok[8]=31;
  26. honapok[9]=30;
  27. honapok[10]=31;
  28. honapok[11]=30;
  29. honapok[12]=31;
  30.  
  31. Console.WriteLine("Írd be a hónapot ! (1-12)");
  32. int honap = int.Parse(Console.ReadLine());
  33.  
  34. bool bekapode = false;
  35. if (honap == 2)
  36. bekapode = true;
  37.  
  38. if (ev % 400 == 0 || ev % 4 == 0 && ev % 100 != 0 )
  39. {
  40. if (bekapode)
  41. {
  42. Console.Write("ez a hónap ennyi napos : ");
  43. Console.Write(honapok[0]);
  44. }
  45.  
  46.  
  47. }
  48. else
  49. {
  50. Console.Write("ez a hónap ennyi napos : ");
  51. Console.Write(honapok[honap]);
  52. }
  53. Console.ReadLine();
  54.  
  55.  
  56.  
  57.  
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement