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