Tajriba ishi topshirdi: babajanov anvarbek


Download 152.59 Kb.
Sana15.06.2023
Hajmi152.59 Kb.
#1484669
Bog'liq
1-lab №9 Bobojonov Anvar



O‘ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI
MUXAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI URGANCH FILIALI
KOMPYUTER INJINERINGI”FAKULTETI 961-20 GURUH TALABASI BABAJANOV ANVARBEKNING ALGORITMLARNI LOYIHALASH FANIDAN


TAJRIBA ISHI

TOPSHIRDI: BABAJANOV ANVARBEK
QABUL QILDI:

9-masala (1.1)


Koeffitsiyentlari a=1, b= 8, c=7 bo’lgan kvadrat tenglama ildizlari topilsin; Tomonlari a=12, b=15, c=9 bo’lgan uchburchak yuzi topilsin
Javob:
C++
#include
#include
using namespace std;
int main()
{
double a;
double b;
double c;
double x;
cout << "a ni kiriting: ";
cin >> a;
cout << "b ni kiriting: ";
cin >> b;
cout << "c ni kiriting: ";
cin >> c;
if((b*b - 4*a*c) >= 0)
{
x = ( -1*b + sqrt(b*b - 4*a*c) ) / (2 * a);
cout << "Birinchi ildiz " << x << endl;
x = ( -1*b - sqrt(b*b - 4*a*c) ) / (2 * a);
cout << "Ikknchi ildiz " << x << endl;
}
else
{
cout << "Diskriminant 0 dan kichik, ildizlari haqiqiy emas." << endl;
}
return 0;
}

1-masala (1.2)


Tomonlari a=12, b=15, c=9 bo’lgan uchburchak yuzi topilsin
Javob:
Java.

public class Main


{
public static void main(String[] args) {
int a = 12;
int b = 15;
int c = 9;
if (a+b <= c || a+c <= b || b+c <= a){
System.out.println("Uchburchak yasab bo'lmaydi\n");
}
else{
if (a != b && a != c && b != c){
System.out.println("Uchburchak yasash mumkin");
}
if (a == b && b == c)
System.out.println("Uchburchak yasash mumkin");
else{
System.out.println("Uchburchak yasash mumkin");
}
}
int P = (a+b+c)/2;
int S = P * (P-a)*(P-b)*(P-c);
System.out.println("S = "+S);
}
}

1-masala (1.3)



Javob:
a = 1.0
b = 6
c = 9
d = 0
q = (3*a*c - b**2) / (9 * a**2)
r = (9*a*b*c - 27*a**2*d - 2*b**3) / (54*a**3)
print ("r = ",r)
rho = (-q**3)**0.5
s_real = rho**(1./3.)
t_real = rho**(1./3.)
print ("A = ",s_real)
print ("B = ",t_real)
x1 = s_real + t_real - b / (3. * a)
print ("x1 = ", x1)

Download 152.59 Kb.

Do'stlaringiz bilan baham:




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