Yechimi: Pascal tilida
Download 46.47 Kb.
|
Begin
Yechimi:
Pascal tilida program begin20;
C++ tilida #include #include #include int main() { float x1,x2,y1,y2; cout<<"Ikkita nuqta koordinatalarini kiriting:\n"; cout<<"x1 = "; cin>>x1; cout<<"x2 = "; cin>>x2; cout<<"y1 = "; cin>>y1; cout<<"y2 = "; cin>>y2; float C=sqrt(pow(x2-x1,2)+pow(y2-y1,2)); cout<<"Ikki nuqta orasidagi masofa = "< } Begin21. Uchburchakning uchta tomoni uchlari koordinatlari berilgan (x1,y1), (x2,y2), (x3,y3) ikki nuqta orasidagi masofani topish . Uchburchakning yuzasini va perimatrini toping. p=(a+b+c)/2 Yechimi: Pascal tilida C++ tilida #include #include #include int main() { float x1,x2,x3,y1,y2,y3; cout<<"Ikkita nuqta koordinatalarini kiriting:\n"; cout<<"x1 = "; cin>>x1; cout<<"y1 = "; cin>>y1; cout<<"x2 = "; cin>>x2; cout<<"y2 = "; cin>>y2; cout<<"x3 = "; cin>>x3; cout<<"y3 = "; cin>>y3; float a=sqrt(pow(x2-x1,2)+pow(y2-y1,2)); float b=sqrt(pow(x2-x3,2)+pow(y2-y3,2)); float c=sqrt(pow(x3-x1,2)+pow(y3-y1,2)); float p=(a+b+c)/2; float s=sqrt(p*(p-a)*(p-b)*(p-c)); cout<<"Uchburchakning yuzi = "< } Begin22. Berilgan A va В sonlarining qiymatlarini almashtiring. A va В ning yangi qiymati ekranga chiqarilsin. 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