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 Area_of_Figures
- {
- class Program
- {
- static void Main(string[] args)
- {
- string typeOfFigure = Console.ReadLine();
- if (typeOfFigure == "square")
- {
- double parameterForArea = double.Parse(Console.ReadLine());
- double area = parameterForArea * parameterForArea;
- Console.WriteLine($"{area:F3}");
- }
- else if (typeOfFigure== "rectangle")
- {
- int sideA = int.Parse(Console.ReadLine());
- double sideB = double.Parse(Console.ReadLine());
- double resultArea = sideA * sideB;
- Console.WriteLine($"{resultArea:F3}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement