Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Volleyball
- {
- static void Main(string[] args)
- {
- string typeOfYear = Console.ReadLine().ToLower();
- int holidays = int.Parse(Console.ReadLine());
- int weekendsInHometown = int.Parse(Console.ReadLine());
- int weekendsForVolleyball = 48;
- double weekednsInSofia = (weekendsForVolleyball - weekendsInHometown)*0.750;
- double volleyballInHolidays = holidays * 0.666;
- double totalVolleyball = weekednsInSofia + weekendsInHometown + volleyballInHolidays;
- if (typeOfYear == "leap")
- {
- double leapYear = totalVolleyball * 0.150;
- totalVolleyball += leapYear;
- Console.WriteLine(Math.Truncate(totalVolleyball));
- }
- else if (typeOfYear =="normal")
- {
- Console.WriteLine(Math.Truncate(totalVolleyball));
- }
- else
- {
- Console.WriteLine("unknown type of year on line 1");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement