Advertisement
spasnikolov131

Untitled

Aug 5th, 2022
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06._Vet_Parking
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int countDays = int.Parse(Console.ReadLine());
  10. int countHours = int.Parse(Console.ReadLine());
  11.  
  12.  
  13. double parkTax = 0;
  14. double total = 0;
  15.  
  16. for (int i = 1; i <= countDays; i++)
  17. {
  18. for (int j = 1; j <= countHours; j++)
  19. {
  20. if (i % 2 == 0 && j % 2 != 0)
  21. {
  22. parkTax += 2.50;
  23. }
  24. else if (i % 2 != 0 && j % 2 == 0)
  25. {
  26. parkTax += 1.25;
  27. }
  28. else
  29. {
  30. parkTax += 1.0;
  31. }
  32. }
  33. total += parkTax;
  34. Console.WriteLine($"Day: {i} - {parkTax:f2} leva");
  35. parkTax = 0;
  36. }
  37. Console.WriteLine($"Total: {total:f2} leva");
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. }
  49. }
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement