Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace softuni_basicExam
- {
- class Program
- {
- static void Main(string[] args)
- {
- int locations = int.Parse(Console.ReadLine());
- double averageGoldSum = 0;
- for (int i = 1; i <= locations; i++)
- {
- double averageGoldPerDayd = double.Parse(Console.ReadLine());
- int mineDays = int.Parse(Console.ReadLine());
- for (int k = 1; k <=mineDays; k++)
- {
- double gold = double.Parse(Console.ReadLine());
- averageGoldSum += gold;
- }
- averageGoldSum /= mineDays;
- if (averageGoldSum >= averageGoldPerDayd)
- {
- Console.WriteLine($"Good job! Average gold per day: {averageGoldSum:f2}.");
- }
- else
- {
- Console.WriteLine($"You need {averageGoldPerDayd - averageGoldSum:f2} gold.");
- }
- averageGoldSum = 0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement