Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Deployment.Internal;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace issue1
- {
- class Program
- {
- private static double House(double lenghtA, double HeightB)
- {
- double onesidebody = lenghtA*(lenghtA/2);
- double backsidesqyare =(lenghtA/2)*(lenghtA/2);
- double backsidetriangle = (lenghtA/2)*(HeightB - (lenghtA/2));
- double backsidetrianglee = backsidetriangle/2;
- double backside = backsidesqyare + backsidetrianglee;
- double door =(lenghtA/5)*(lenghtA/5);
- double frontside = (backsidetrianglee + backsidesqyare) - door;
- double house = backside + frontside + (2*onesidebody);
- return house;
- }
- private static double Roof(double lengthA)
- {
- double roofoneside = lengthA*(lengthA/2);
- double roof = 2*roofoneside;
- return roof;
- }
- static void Main(string[] args)
- {
- //input
- double lenghtA = double.Parse(Console.ReadLine());
- double HeightB =double.Parse(Console.ReadLine());
- double greenPaint =House(lenghtA,HeightB)/ 3;
- double redpaint = Roof(lenghtA)/ 5;
- Console.WriteLine("{0:f2}",greenPaint);
- Console.WriteLine("{0:f2}",redpaint);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment