Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace housePainting
- {
- class Program
- {
- static void Main(string[] args)
- {
- int x = int.Parse(Console.ReadLine()); //Височина на къщата
- int y = int.Parse(Console.ReadLine()); //дължина на страничната стена
- int h = int.Parse(Console.ReadLine()); // височина на предния триъгълник
- //1. откриване площта на правоъгълните стени
- int areaSides = ((x * y) * 2) + ((x * x) * 2);
- double doorArea = 1.2 * 2;
- double windowsArea = (1.5 * 1.5) * 2;
- double areaWallsForPainting = areaSides - doorArea - windowsArea; //площ за боядисване
- //2. откриване площта на покрива
- int roofRectangle = x * y * 2;
- int roofTriangle = ((x * h) / 2)*2;
- int roofArea = roofRectangle + roofTriangle;
- //3. разход за боя в литри
- double greenPaint = areaWallsForPainting / 3.4;
- double redPaint = roofArea / 4.3;
- Console.WriteLine($"{greenPaint:F2}");
- Console.WriteLine($"{redPaint:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement