Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Electricity
- {
- class Electricity
- {
- static void Main()
- {
- int numOfFloors = int.Parse(Console.ReadLine());
- int numOfFlats = int.Parse(Console.ReadLine());
- string time = Console.ReadLine();
- string[] arrTime = time.Split(':');
- int hours = int.Parse(arrTime[0]);
- int minutes = int.Parse(arrTime[1]);
- double totalPowerConsummation = 0;
- if (hours >= 14 && hours <= 18)
- {
- totalPowerConsummation = numOfFlats*numOfFloors*(125.90d + 100.53d)*2;
- }
- if (hours >= 19 && hours <= 23)
- {
- totalPowerConsummation = numOfFlats * numOfFloors * (6*125.90d + 7*100.53d);
- }
- if (hours >= 0 && hours <= 8)
- {
- totalPowerConsummation = numOfFlats * numOfFloors * (8 * 125.90d + 1 * 100.53d);
- }
- Console.WriteLine("{0} Watts", (int)totalPowerConsummation);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement