Advertisement
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 expenses
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine());
- double Electricity = 0;
- double Water = 0;
- double Internet = 0;
- double Other = 0;
- double Average = 0;
- double months = 0;
- for (int i = 0; i < n; i++)
- {
- months = double.Parse(Console.ReadLine());
- Electricity++;
- }
- Electricity = Electricity + Electricity;
- //Console.WriteLine(Electricity);
- Water = months * 20;
- Internet = months * 15;
- Other = (Electricity + 20 + 15) * 1.20;
- Average = (Electricity + Water + Other) / months;
- Console.WriteLine($"Electricity:{Electricity:f2}");
- Console.WriteLine($"Water:{Water:f2}");
- Console.WriteLine($"Internet:{Internet:f2}");
- Console.WriteLine($"Average{Average:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement