Begin 19. to'g'ri to'rtburchakning qarama-qarshi uchlari koordinatalari berilgan. Uning tomonlari koordinata o'qiga parallel. To'g'ri to'rtburchak perimetri va yuzasi aniqlansin


Download 11.91 Kb.
Sana27.03.2023
Hajmi11.91 Kb.
#1300655
Bog'liq
Muhlisa1

1-misol.
begin 19. to'g'ri to'rtburchakning qarama-qarshi uchlari koordinatalari berilgan. Uning tomonlari koordinata o'qiga parallel. To'g'ri to'rtburchak perimetri va yuzasi aniqlansin.


1-usul
using System;
class HelloWorld {
static void TugriTurtburchak(){
double x1,x2,y1,y2;
Console.Write("Tug'ri turtburchakning qarama-qarshi uchlari koordinatasini kiriting:x1=");
x1=Convert.ToDouble(Console.ReadLine());
Console.Write("x2=");
x2=Convert.ToDouble(Console.ReadLine());
Console.Write("y1=");
y1=Convert.ToDouble(Console.ReadLine());
Console.Write("y2=");
y2=Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Turtburchak perimetiri " +(2*(Math.Abs(x2-x1)+Math.Abs(y2-y1)))+" ga teng.");
Console.WriteLine("Turtburchak yuzi "+(Math.Abs(x2-x1)*Math.Abs(y2-y1))+" ga teng.");
}
public static void Main()
{
TugriTurtburchak();
Console.ReadKey(true);
}
}
Download 11.91 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling