Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Bills
- {
- using System;
- class Bills
- {
- static void Main()
- {
- int months = int.Parse(Console.ReadLine());
- double electricitySum = 0;
- for (int i = 0; i < months; i++)
- {
- double electricityBill = double.Parse(Console.ReadLine());
- electricitySum += electricityBill;
- }
- double water = months * 20;
- double internet = months * 15;
- double otherBills = (electricitySum + water + internet) * 1.2;
- double average = (electricitySum + water + internet + otherBills) / months;
- Console.WriteLine($"Electricity: {electricitySum:f2} lv");
- Console.WriteLine($"Water: {water:f2} lv");
- Console.WriteLine($"Internet: {internet:F2} lv");
- Console.WriteLine($"Other: {otherBills:f2} lv");
- Console.WriteLine($"Average: {average:f2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement