Advertisement
Somo4k

06. VetParking

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