Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Exam_Family_House
- {
- class Program
- {
- static void Main(string[] args)
- {
- int months = int.Parse(Console.ReadLine());
- double sumElectricity = 0;
- for (int i = 0; i < months; i++)
- {
- sumElectricity += double.Parse(Console.ReadLine());
- }
- double sumOther = (sumElectricity + months * 35) * 1.20;
- Console.WriteLine($"Electricity: {sumElectricity:F2} lv");
- Console.WriteLine($"Water: {months * 20:F2} lv");
- Console.WriteLine($"Internet: {months * 15:F2} lv");
- Console.WriteLine($"Other: {sumOther:F2} lv");
- Console.WriteLine($"Average: {(sumElectricity + sumOther + months * 35) / months:F2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment