Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Volleyball
- {
- class Program
- {
- static void Main(string[] args)
- {
- string year = Console.ReadLine();
- int p = int.Parse(Console.ReadLine()); // брой празници в година (без събота и неделя);
- int h = int.Parse(Console.ReadLine()); // брой уикенди, в които Влади си пътува до родния край;
- int weekendSf = 48 - h; // Sofia weekends
- double totalGamesSf = weekendSf * (3.0/4.0); // sum of games in sofia
- double totalGamesHome = h;
- double totalGamesHolidays = p * (2.0/3.0); // 2/3 = 0.666666..;
- double totalPlays = totalGamesSf + totalGamesHome + totalGamesHolidays;
- if (year == "normal")
- {
- Console.WriteLine(Math.Floor(totalPlays));
- }
- else if (year == "leap")
- {
- double leapTotalPlays = totalPlays * 0.15;
- totalPlays += leapTotalPlays;
- Console.WriteLine(Math.Floor(totalPlays));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement