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