Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace VeterinarenParking
- {
- class VeterinarenParking
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- int hours = int.Parse(Console.ReadLine());
- double price = 0;
- double cntPrice = 0;
- double cntPrice1 = 0;
- double cntPrice2 = 0;
- for (int i = 1; i <= days; i++)
- {
- for (int n = 1; n <= hours; n++)
- {
- if (i % 2 == 0 && n % 2 != 0)
- {
- price = 2.50;
- cntPrice = cntPrice + price;
- }
- if (i % 2 != 0 && n % 2 == 0)
- {
- price = 1.25;
- cntPrice1 = cntPrice1 + price;
- }
- else
- {
- price = 1;
- cntPrice2 = cntPrice2 + price;
- }
- if (i == 1)
- {
- double newPrice = price * hours;
- Console.WriteLine($"Day: {i} – {newPrice:f2} leva");
- }
- if (i == 2)
- {
- double newPrice = price * hours;
- Console.WriteLine($"Day: {i} – {newPrice:f2} leva");
- }
- if (i == 3)
- {
- double newPrice = price * hours;
- Console.WriteLine($"Day: {i} – {newPrice:f2} leva");
- }
- if (i == 4)
- {
- double newPrice = price * hours;
- Console.WriteLine($"Day: {i} – {newPrice:f2} leva");
- }
- if (i == 5)
- {
- double newPrice = price * hours;
- Console.WriteLine($"Day: {i} – {newPrice:f2} leva");
- }
- }
- }
- double sum = cntPrice + cntPrice1 + cntPrice2;
- Console.WriteLine($"Total: {sum:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement