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