Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _6.VetParking
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- int hours = int.Parse(Console.ReadLine());
- double sumPerDay = 0;
- double totalSum = 0;
- for (int day = 1; day <= days; day++)
- {
- for (int hour = 1; hour <= hours; hour++)
- {
- if (day % 2 == 0 && hour % 2 != 0)
- {
- sumPerDay += 2.5;
- }
- else if (day % 2 != 0 && hour % 2 == 0)
- {
- sumPerDay += 1.25;
- }
- else
- {
- sumPerDay += 1.0;
- }
- }
- Console.WriteLine($"Day: {day} - {sumPerDay:f2} leva");
- totalSum += sumPerDay;
- sumPerDay = 0;
- }
- Console.WriteLine($"Total: {totalSum:f2} leva");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement