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 Area_of_Figures
- {
- class Program
- {
- static void Main(string[] args)
- {
- string figure = Console.ReadLine();
- double a = double.Parse(Console.ReadLine());
- var square = (a * a);
- var circle = Math.PI*(a * a);
- if (figure == "square")
- {
- Console.WriteLine(square);
- }
- else if (figure == "circle")
- {
- Console.WriteLine(circle);
- }
- double b = double.Parse(Console.ReadLine());
- var rectangle = (a * b);
- var triangle = (a * b) / 2;
- if (figure == "rectangle")
- {
- Console.WriteLine(rectangle);
- }
- else if (figure == "triangle")
- {
- Console.WriteLine(rectangle);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment