4. Dinamik ma‟lumotlar tuzilmasi haqida ma’lumot bering
A 10 y=x2+2x+6 funksiyaning qiymatini [1..10] oraliqda hisoblash dasturini tuzing
Download 418.97 Kb.
|
algoritm — копия (2)
117. 2 A 10 y=x2+2x+6 funksiyaning qiymatini [1..10] oraliqda hisoblash dasturini tuzing.
#include #include using namespace std; int main(){ int x,y; cin>>x; y=pow(x,2)+2*x+6; if(1<=x && x<=10) cout< cout<<" iltimos 1 va 10 oralig`idagi sonni kiriting"; return 0; } 118. 2 A 10 y=2x2+2x-9 funksiyaning qiymatini [1..20] oraliqda hisoblash dasturini tuzing. #include #include using namespace std; int main(){ int x,y; cin>>x; y=pow(x,2)+2*x-9; if(1<=x && x<=20) cout< cout<<" iltimos 1 va 20 oralig`idagi sonni kiriting"; return 0; } 119. 2 A 10 y=x2-3x+16 funksiyaning qiymatini [5..20] oraliqda hisoblash dasturinituzing. #include #include using namespace std; int main(){ int x,y; cin>>x; y=pow(x,2)-3*x+16; if(5<=x && x<=20) cout< cout<<" iltimos 5 va 20 oralig`idagi sonni kiriting"; return 0; } 120. 2 A 14 Piramidaning hajmi va balandligi berilgan.Uning asosining yuzini toppish algoritm va dasturini tuzing #include #include using namespace std; int main(){ float s,v,h,pi=3.14; cin>>v>>h; s=v*3/h; cout<<"yon sirti -> "< } 121. Agar y, y=2x2+5,5t-2, t=x+2 formula bilan berilgan bo‟lsa, x ning 4, 5, ...,28 qiymatlari uchun y ning qiymatini hisoblang. #include #include using namespace std; int main(){ float y,x,t; cout<<"iltimos [4..28] oraliqda son kiriting: "< t=x+2; y=2*pow(x,2)+5.5*t-2; cout<<"y -> "< } 122. Uchburchakning uch xil holati berilgan. 1-holat: uchta tomon. 2-holat: ikkita tomon va ular orasidagi burchak. 3-holat: asos va balandlik. Foydalanuvchi kiritgan holatga qarab uchburchak yuzini topish dasturini tuzing. #include #include using namespace std; int main(){ float a,b,c,p,s1,s2,s3,q,h,t=3.14/180; cin>>a>>b>>c; cout<<"burchak=";cin>>p; cout<<"balandlik=";cin>>h; p=(a+b+c)/2; s1=sqrt(p*(p-a)*(p-b)*(p-c)); s2=sin(p*t)*a*b/2; s3=a*h/2; cout<<"1- holat un s1=sqrt(p*(p-a)*(p-b)*(p-c)) -> "< }
123. Ikkita butun A va B sonlari berilgan. Jumlani rostlikka tekshiring. “A>2 va B<=3”. #include using namespace std; int main(){ int A,B; cin>>A>>B; if(A>2&&B<=3) cout<<"Rost"; else cout<<"Yolg`on"; return 0; } 124. OX o‟qida uchta nuqta joylashgan: a, b, c. a ga b yoki c nuqtadan qaysi biri yaqin joylashganligini aniqlang. #include #include using namespace std; int main(){ int a,b,c,x,y; cin>>a>>b>>c; x=abs(b)-abs(a); y=abs(c)-abs(a); if(x>y) cout<<"a ga c yaqin"< cout<<"a ga b yaqin"; return 0; } 125. Kvadrat tomoni a berilgan. Uning yuzini, perimetrini va diametrini topish dasturini tuzing. #include #include using namespace std; int main(){ int a,y,p,d; cin>>a; y=a*a; p=(a+a)*2; d=sqrt(2)*a; cout<<"yuzi -> "< cout<<"diyaganali -> "< } 126. Aylananing diametri d berilgan. Uning uzunligi topish dasturini tuzing. π qiymatini konstanta sifatida oling. #include #include using namespace std; int main(){ float d,l,pi=3.14; cin>>d; l=d*pi; cout<<"aylana uzuznligi -> "< } 127. 1 A 3 Kubning tomoni berilgan. Uning hajmini va to‟la sirti yuzasini topish dasturini tuzing. #include #include using namespace std; int main(){ int a,v,s; cin>>a; v=pow(a,3); s=6*a*a; cout<<"kubning hajmi -> "< } 128. To’g’ri burchakli parallelipipedning asosi tomonlari va balandligi berilgan. Uning hajmini va to‟la sirti yuzasini topish dasturini tuzing. #include #include using namespace std; int main(){ int a,b,c,v,s; cin>>a>>b>>c; v=a*b*c; s=2*(a*b+a*c+b*c); cout<<"parallelipipedning hajmi -> "< } 129. Aylaning uzunligini qiymati berilgan. Ushbu aylana bilan chegaralangan doiraning yuzasini topish dasturini tuzing. 130.Ikkita natural son berilgan. Ushbu sonlarning o‟rta arifmetigini va o’rta geometrigini topish dasturini tuzing. //130 #include #include using namespace std; int main(){ float a, b; float c,d; cin>>a>>b; c=(a+b)/2; d=sqrt(a*b); cout<<"o`rta arifmetigi -> "< 131.Ikkita nolga teng bo‟lmagan butun sonlar berilgan. Bu ikki sonning ayirmasi modulini, bo‟linmasi va yig‟indisi kvadratini hisoblovchi dastur tuzing. #include using namespace std; int main(){ int a,b,q,w,e; cin>>a>>b; q=abs(a-b); w=(a/b)*(a/b); e=(a+b)*(a+b); cout<<"ayirmasining moduli = "<cout< 132.To‟g‟ri burchakli uchburchakning a va b katetlari berilgan. Uningyuzasini, perimetrini, gipotenuzasiga tushirilgan balandlik va medianasini topish dasturini tuzing. #include #include using namespace std; int main(){ float a, b, P, S, m, h, c; cout<<"a="; cin>>a; cout<<"b="; cin>>b; c=sqrt(pow(a,2)+pow(b,2)); S=a*b/2; cout<<"yuzasi="< cout<<"perimetri="< m=c/2; cout<<"mediana="< cout<<"balandligi="< } 133.Umumiy markazga ega bo‟lgan ikkita doira bir-biriga ichki chizilgan. Ichki va tashqi doiralarning radiuslari berilgan. Hosil bo‟lgan halqaning yuzini topish dasturini tuzing. π qiymatini konstanta sifatida oling. #include using namespace std; int main(){ int r,R,pi=3.14,s,s1,s2; cin>>R>>r; s1=pi*r*r; s2=pi*R*R; s=s2-s1; cout<<"halqaning yuzi = "< 134.Doiraning yuzasi S berilgan. Ushbu doiraning diametrini va radiusini topish dasturini tuzing. #include #include using namespace std; int main(){ float s,r,pi=3.14,d; cin>>s; r=sqrt(s/pi); d=r*2; cout<<"radiusi -> "< } 135.Uchburchakning a, b, c tomonlari berilgan. Ushbu uchburchakning barcha burchaklarini topish dasturini tuzing. 136.Kruskal algoritmining murakkabligini baholang. 137.Uchburchakning barcha uchlarining koordinatalari berilgan. Ushbu uchburchakning yuzasini topish dasturini tuzing. #include #include using namespace std; int main(){ int a,b,c,x,y,x1,y1,x2,y2,s; cout<<"x="; cin>>x; cout<<"y="; cin>>y; cout<<"x1="; cin>>x1; cout<<"y1="; cin>>y1; cout<<"x2="; cin>>x2; cout<<"y2="; cin>>y2; a=sqrt(pow((x1-x),2)+pow((y1-y),2)); b=sqrt(pow((x2-x1),2)+pow((y2-y1),2)); b=sqrt(pow((x-x2),2)+pow((y-y2),2)); s=sqrt(((a+b+c)/2)*((a+b+c)/2-a)*((a+b+c)/2-b)*((a+b+c)/2-c)); cout< 138.A, B, C o‟zgaruvchilar qiymatlari bilan berilgan. Shunday dastur tuzingki, A o‟zgaruvchi qiymati C o‟zgaruvchiga, C o‟zgaruvchi qiymati B ga, B o‟zgaruvchi qiymati A ga teng bo‟ls Misol: Dastlab, A=2, B=3, C=5. So‟ngra. A=5, B=2, C=3. #include #include using namespace std; int main(){ int A,B,C; cin>>A>>B>>C; cout<<"A="< 139.10 ning barcha haqiqiy qiymatlarida funksiyaning qiymatini hisoblang. 140.Berilgan grafning barcha tushunchalarini keltiring (uchlar, qirralar, grafning yo‟nalishga ega yoki yo‟qligi bo‟yicha aniqlanishi, yakkalangan uch mavjudligi, regular yoki regular emasligi va hokazo).141. 1 A 12 ax b 0 a 0 chiziqli tenglamani yechadigan dastur tuzing. 142.To‟rt xonali natural son berilgan. Ushbu sonning raqamlari yig‟indisini topish dasturini tuzing. 143.Uch xonali natural son berilgan. Ushbu sonni teskari tartibda yozuvchi dastur tuzing. 144.Yuzasi berilgan kvadratga ichki chizilgan. Bu aylanaga ichki chizilgan kvadart yuzasini topish dasturini tuzing. Berilgan kvadrat yuzasidan ichki chizilgan kvadrat yuzasi necha marta kichikligini chop eting. 145.Teng tomonli uchburchakning tomonlari a bilan ifodalanadi. Uning balandligini topish algoritmini tuzing. 146.Teng tomonli uchburchakning tomonlari a bilan ifodalanadi. Uning balandligini topish algoritmini tuzing. 147. Temperatura TF gradus Selsiyda berilgan. Temperatura qiymatini TC Farangeytga o‟tkazuvchi dastur tuzing. Ko’rsatma: TC = (TF – 32) 5/9 #include #include using namespace std; int main(){ float TF,TC; cin>>TF; TC=(TF-32)*(5/9); cout< 148. A1, B1, C1, A2, B2, C2 koeffisiyentlari bilan berilgan, chiziqli tenglamalar sistemasi yechimlarini topuvchi dastur tuzing: Bunda deb hisoblang. 149. 2 A 8 Ikkita A va B haqiqiy sonlar berilgan. Bu ikki qiymatni o‟zaro almashtirish dasturini tuzing. Misol: Dastlab, A=2 B=3, so‟ngra A=3, B=2 #include #include using namespace std; int main(){ float a,b; cout<<"A="; cin>>a; cout<<"B="; cin>>b; cout< 150.Sonlar o‟qida A, B, C nuqtalar berilgan. AC va BC kesmalarning uzunligini va kesmalar uzunligining ko‟paytmasini topish dasturini tuzing. 151. Sonlar o‟qida ikki nuqta berilgan. Bu nuqtalar orasidagi masofani topish dasturini tuzing. 152.Faylning hajmi baytlarda berilgan. Ushbu fayl necha Kb, Mb va Gb ekanligini topish dasturini tuzing. 153. Uch xonali natural son berilgan. Ushbu sonning oxirgi raqamini boshiga o‟tkazish algoritmi va dasturini tuzing. Misol: A=231. Almashtirishdan so‟ng, A=123. 154.Uchta haqiqiy x,y,z sonlardan eng kattasini aniqlash dasturini tuzing. 155.ko‟rinishidagi kvadrat tenglamaning barcha yechimlarini topish dasturini tuzing 156. Uchta haqiqiy sonlar berilgan. Ulardan nechtasi (1,3) intervalga kirishini aniqlovchi dastur tuzing. Agar bitta qiymat kirsa “BIR”, ikkita qiymat kirsa “IKKI”, barchasi kirsa “UCH” yozuvlari, birorta ham kirmasi 0 qiymati chop etilsin #include using namespace std; int main(){ float a,b,c; int k=0; cout<<"a="; cin>>a; cout<<"b="; cin>>b; cout<<"c="; cin>>c; if(1 if(1 if(1 case 0: cout<<0; break; case 1: cout<<"Bir"; break; case 2: cout<<"Ikki"; break; case 3: cout<<"Uch"; break; } return 0; } 150. 1 A 18 Sonlar o‟qida A, B, C nuqtalar berilgan. AC va BC kesmalarning uzunligini va kesmalar uzunligining ko‟paytmasini topish dasturini tuzing. #include #include using namespace std; int main(){ float a,b,c; cout<<"a="; cin>>a; cout<<"b="; cin>>b; cout<<"c="; cin>>c; cout< } |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2025
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling