Aggrodin

01. Joro The Football Player

Apr 18th, 2014
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2. namespace DNA
  3. {
  4.     class Programmer
  5.     {
  6.         static void Main()
  7.         {
  8.             string leapOrNot = Console.ReadLine();
  9.             int p = int.Parse(Console.ReadLine());
  10.             int h = int.Parse(Console.ReadLine());
  11.             int weekends = 52;
  12.             int result = 0;
  13.             if ( leapOrNot == "t") // if the year is leap
  14.             {
  15.                 p = (p / 2);
  16.                 h = h / (1 % 3);
  17.                 weekends = ((weekends - h) * 2) / 3;  
  18.                 result = p + h +  weekends + 3;
  19.                 Console.WriteLine(result);
  20.             }        
  21.             else if ( leapOrNot == "f")  // if its not
  22.             {
  23.                 p = (p / 2) ;
  24.                 h = h / (1 % 3);
  25.                 weekends = ((weekends - h) * 2) / 3;
  26.                 result = p + h + weekends;
  27.                 Console.WriteLine(result);
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment