Yechimi: Pascal tilida
Download 46.47 Kb.
|
Begin
Yechimi:
Pascal tilida Program begin18; uses crt; var a,b,s,as,bs,ss:real; begin writeln(‘Sonlar o`qida uchta nuqta koordinatalarini kiriting’); write('a='); read(a); write('b='); read(b); write('s='); read(s); as:=abs(a-c); writeln(‘A va S nuqtalar orasidagi masofa ’,as,’ ga teng’); bs:=abs(b-s); writeln(‘B va S nuqtalar orasidagi masofa ’,bs,’ ga teng’); ss:=as*bs; writeln(‘AS va AS chiziqlar uzunliklari ko`paytmasi ’,ss,’ ga teng’); readkey; end. C++ tilida #include #include #include int main() { float a,b,s; cout<<"Sonlar o`qida uchta nuqta koordinatalarini kiriting\n"; cout<<"a = "; cin>>a; cout<<"b = "; cin>>b; cout<<"s = "; cin>>s; float as=abs(a-s); cout<<"A va S nuqtalar orasidagi masofa "< cout<<"B va S nuqtalar orasidagi masofa "< cout<<"AS va AS chiziqlar uzunliklari ko`paytmasi "< } Begin19. To'g'ri to'rtburchakning qarama-qarshi uchlari koordinatlari berilgan. Uning tomonlari koordinata o'qiga parallel. To'g'ri to'rtburchakning perimetri va yuzasi aniqlansin. Yechimi: Pascal tilida Program begin19; uses crt; var x1,x2,y1,y2,s,p:real; begin writeln(‘To`g`ri to`rtburchakning qarama qarshi uchlari koordinatalarini kiriting:’); write('x1='); read(x1); write('y1='); read(y1); write('x2='); read(x2); write('y2='); read(y2); p:=2*(abs(x2-x1)+abs(y1-y2)); write(‘To`g`ri to`rtburchakning perimetri ’,p,’ ga teng’); s:=abs(x2-x1)*abs(y1-y2); write(‘To`g`ri to`rtburchakning yuzi ’,s,’ ga teng’); readkey; end. C++ tilida Begin20. Tekislikdagi berilgan ikki nuqta (x1,y1) va (x2,y2) orasidagi masofa topilsin. Download 46.47 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling