Advertisement
Alexander_B

Voleyball

Feb 3rd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DomashnoJourney
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. // get input --> yearKind - leap or normal; int p - number of hollydays except weekend; int h - number of weekend Vladi goes to home town
  14.  
  15. string yearKind = Console.ReadLine().ToLower();
  16. int p = int.Parse(Console.ReadLine());
  17. int h = int.Parse(Console.ReadLine());
  18.  
  19. // calculate --> allWeekend = 48; weekendsInSofia = allWeeknd-h;
  20.  
  21. double allWeekend = 48.00;
  22. double weekendInSofia = allWeekend - h;
  23.  
  24. // calculate --> leapAgregate = 15; allGames = 0.00; playInSofia = weekendsInSofia*3/4+2/3p; playInSelo = h;
  25.  
  26. double leapAgregate = 15;
  27. double allGames = 0.00;
  28. double playInSofia = (1.00 * weekendInSofia * 3 / 4) + (1.00 * 2 / 3 * p);
  29. double playInSelo = 1.00*h;
  30. double toPrint = 0.00;
  31.  
  32. if (yearKind == "leap")
  33. {
  34. allGames = (playInSofia + playInSelo) * (1 + (1.00 * leapAgregate / 100));
  35. toPrint = Math.Floor(allGames);
  36. }
  37. else
  38. {
  39. allGames = playInSelo + playInSofia;
  40. toPrint = Math.Floor(allGames);
  41. }
  42.  
  43. // print zakrygleno nadolu
  44.  
  45. Console.WriteLine(toPrint);
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement