Anzzhhela98

cv

Jun 5th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Vladi
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string leapOrNormal = Console.ReadLine();
  10.             double p = double.Parse(Console.ReadLine());
  11.             double h = double.Parse(Console.ReadLine());
  12.  
  13.             double weekends = 48 ;
  14.             double weekendSofia = (weekends - h) * 3 / 4;
  15.            
  16.             double daytravel = h;
  17.             double dayholiday = p * 2 / 3;
  18.  
  19.             double totalPlayTime = weekendSofia + daytravel + dayholiday;
  20.             double finalPlay = 0;
  21.  
  22.             if (leapOrNormal == "leap")
  23.             {
  24.                finalPlay= totalPlayTime * 0.15 + totalPlayTime;
  25.                 Console.WriteLine($"{Math.Floor(finalPlay)}");
  26.             }
  27.             else if (leapOrNormal=="normal")
  28.             {
  29.                 Console.WriteLine($"{Math.Floor(totalPlayTime)}");
  30.             }
  31.            
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment