dayana_Velkova

Untitled

May 23rd, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 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 _12.Volleyball
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string typeYears = Console.ReadLine();
  14. int holidayYears = int.Parse(Console.ReadLine());
  15. int weekendTravelHome = int.Parse(Console.ReadLine());
  16.  
  17. //////////София игри///////
  18. double numberWeekendSofia = 48 - weekendTravelHome;
  19. double gameWeekSofia = numberWeekendSofia * 3.0 / 4;
  20.  
  21. //////////Роден град игри///////
  22. double gameWeekendHome = weekendTravelHome;
  23. double gameWeek = holidayYears * 2.0 / 3;
  24.  
  25. ///////////////Сума////////////
  26. double result = gameWeek + gameWeekendHome + gameWeekSofia;
  27.  
  28. switch (typeYears)
  29. {
  30. case "leap":
  31. var procent = 0.15;
  32. result = result + (procent * result);
  33. Console.WriteLine(Math.Truncate(result));
  34. break;
  35. default:
  36. Console.WriteLine(Math.Truncate(result));
  37. break;
  38. }
  39.  
  40.  
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment