Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06._Vet_Parking
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int countDays = int.Parse(Console.ReadLine());
- int countHours = int.Parse(Console.ReadLine());
- double parkTax = 0;
- double total = 0;
- for (int i = 1; i <= countDays; i++)
- {
- for (int j = 1; j <= countHours; j++)
- {
- if (i % 2 == 0 && j % 2 != 0)
- {
- parkTax += 2.50;
- }
- else if (i % 2 != 0 && j % 2 == 0)
- {
- parkTax += 1.25;
- }
- else
- {
- parkTax += 1.0;
- }
- }
- total += parkTax;
- Console.WriteLine($"Day: {i} - {parkTax:f2} leva");
- parkTax = 0;
- }
- Console.WriteLine($"Total: {total:f2} leva");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement