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 exam1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- int hours = int.Parse(Console.ReadLine());
- double sum = 0;
- double sum1 = 0;
- int x = 0;
- int y = 0;
- for (int i = 1; i <= days; i++)
- {
- for (int j = 1; j <= hours; j++)
- {
- if (i % 2 == 0)
- {
- if (j % 2 != 0)
- {
- sum += 2.50;
- }
- else
- {
- sum += 1;
- }
- x = i;
- }
- if (i % 2 != 0)
- {
- if (j % 2 == 0)
- {
- sum1 += 1.25;
- }
- else
- {
- sum1 += 1;
- }
- y = i;
- }
- }
- Console.WriteLine($"Day: {y} - {sum1:f2} leva");
- Console.WriteLine($"Day: {x} - {sum:f2} leva");
- }
- Console.WriteLine($"Total: {sum + sum1:f2} leva");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement