Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Exam
- {
- class Program
- {
- static void Main(string[] args)
- {
- int howManyMonths = int.Parse(Console.ReadLine());
- double elect = 0;
- double moneyAll = 0;
- double electAll = 0;
- double OtherAll = 0;
- for (int i = 0; i < howManyMonths; i++)
- {
- elect = double.Parse(Console.ReadLine());
- electAll += elect;
- OtherAll += (elect + 20 + 15)*1.2;
- moneyAll += (elect + 20 + 15);
- }
- Console.WriteLine($"Electricity: {electAll:F2} lv");
- Console.WriteLine($"Water: {howManyMonths*20:F2} lv");
- Console.WriteLine($"Internet: {howManyMonths*15:F2} lv");
- Console.WriteLine($"Other: {OtherAll:F2} lv");
- Console.WriteLine($"Average: {(moneyAll+OtherAll)/howManyMonths:F2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement