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