Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DomashnoJourney
- {
- class Program
- {
- static void Main(string[] args)
- {
- // get input --> yearKind - leap or normal; int p - number of hollydays except weekend; int h - number of weekend Vladi goes to home town
- string yearKind = Console.ReadLine().ToLower();
- int p = int.Parse(Console.ReadLine());
- int h = int.Parse(Console.ReadLine());
- // calculate --> allWeekend = 48; weekendsInSofia = allWeeknd-h;
- double allWeekend = 48.00;
- double weekendInSofia = allWeekend - h;
- // calculate --> leapAgregate = 15; allGames = 0.00; playInSofia = weekendsInSofia*3/4+2/3p; playInSelo = h;
- double leapAgregate = 15;
- double allGames = 0.00;
- double playInSofia = (1.00 * weekendInSofia * 3 / 4) + (1.00 * 2 / 3 * p);
- double playInSelo = 1.00*h;
- double toPrint = 0.00;
- if (yearKind == "leap")
- {
- allGames = (playInSofia + playInSelo) * (1 + (1.00 * leapAgregate / 100));
- toPrint = Math.Floor(allGames);
- }
- else
- {
- allGames = playInSelo + playInSofia;
- toPrint = Math.Floor(allGames);
- }
- // print zakrygleno nadolu
- Console.WriteLine(toPrint);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement