1-chiziqli algaritmlar
Download 406.13 Kb.
|
1 - amaliy mashgulot
- Bu sahifa navigatsiya:
- 2-tarmoqlanuvchi algaritmlar
- 3-Takrorlanuvchi algaritmlar
- include include using namespace std; int main() { float n; cin>>n;
1-chiziqli algaritmlar O`lchami x bo`lgan qubik berilgan. Uning hajmini toping. Tamom V=x*x*x x boshlash #include #include using namespace std; int main() { double a ,V; cin>>x; V=pow(x,3); cout< Radyuslari r1, r2, r3 bolgan 3 to doira radyuslari berilgan. Doiralarni yuzini hisoblang. #include #include int main() { double r1 ,r2 ,r3 ,S1, S2 , S3 ; cin>>r1>>r2>>r3; Tamom S1= S2 S3 r1 , r2 , r3 boshlash S1= M_PI*pow(r1 ,2); S2= M_PI*pow(r2 ,2); S3= M_PI*pow(r3 ,2); cout< Yuzasi s va balandligi h bo`lgan uch burchag berilgan. Uni asosini toping. Tamom a=S/h S, h boshlash #include #include using namespace std; int main() { double S , a, h; cin>>S>>h; a =S/h; cout< Tamom s r boshlash Radyusi r bo`lgan sharing yuzini toping. #include #include using namespace std; int main() { double r , S ; cin>>r; S=M_PI*4*r*r; cout< a,b va c tamonli uch burchag berilgan. Uch burchagning pirimetiri topilsin. boshlash a, b ,c P=a+b+c Tamom #include #include using namespace std; int main() { double a, b, c , P ; cin>>a>>b>>c; P= a+b+c; cout< Asoslari a va b, balandligi h bo`lgan g`ola yuzini toping. Tamom S=2ab+2bh+2ah a, b ,h boshlash #include #include using namespace std; int main() { double a, b, h ,S; cin>>a>>b>>h; S= 2*a*b+2*b*h+2*a*h; cout< Qo`nisning balandligi h va radyusi r bo`lsa uning hajmi nimaga teng bo`ladi. Tamom V= h/3 a, h boshlash #include #include using namespace std; int main() { double h,r ,V ; cin>>h>>r; V= M_PI*r*r*h*1/3; cout< Tezligi v bo`lgan avtomabil s masofani qancha vaqtda bosib o`tadi. Tamom T=s/v S,v boshlash #include #include using namespace std; int main() { double s, v, t ; cin>>s>>v; t=s/v; cout< Tamom T= H, g=9.81 boshlash h balandlikqan erkin tushayotgan jism qancha vaqtdan keyin erga uriladi. #include #include using namespace std; int main() { double g=9.81 , h ,t; cin>>h; t=sqrt(2*h/g); cout< Tamom V=x*365*0,001*24*60*60 x boshlash Jo`mrakdan 1 s da 1 milli litr suv tomsa x yilda necha litr suv tomadi. #include #include using namespace std; int main() { double x ,V; cin>>x; V= x* 0.001*365*24*60*60; cout< Tamom P=m*g M, g=9.81 boshlash A,B,C sonlar berilgan A ning qiymati B ga, B ning qiymati C ga, C ning aiymati A ga almashtirilsin. Massasi m bo`lgan jismni og`irligini toping. #include #include using namespace std; int main() { double m , g=9.81, P ; cin>>m; P=m*g; cout< m massali jismga a tezlanish berilganda unga qanchali kuch tasir qiladi. Tamom F=ma m, a boshlash #include #include using namespace std; int main() { double a, m, F ; cin>>a>>m; F=m*a; cout< Tomoni a bo’lgan kvadrat berilgan uning peremetrini aniqlang. Tamom P=4a a boshlash #include #include using namespace std; int main() { double a, p; cin>>a; p=4*a; cout< Tekislikda berilgan (x1,y1) va (x2,y2) nuqtalar orasidagi masofani toping. #include Tamom d=sqrt(pow((x2-x1),2)+pow((y2-y1),2)) X1 ,x2,y2,y1 boshlash #include using namespace std; int main() { double x1 ,y1 ,x2 ,y2, d ; cin>>x1>>y1>>x2>>y2; d=sqrt(pow((x2-x1),2)+pow((y2-y1),2)); cout< 2-tarmoqlanuvchi algaritmlar x va y son berilgan bu sonlarlar kattasini va kichigini topish algaritmini tuzing. #include #include using namespace std; int main() { double a ,b, k, m ; cin>>a>>b; k=max(a ,b); m=min(a,b); cout<<"kattasi:"< x, y va z son berilgan bu sonlarlar kattasini va kichigini topish algaritmini tuzing. #include #include using namespace std; int main() { double a, b, c, k, m; cin>>a>>b>>c; k= max(a, max(b ,c)); m=min(a,min(b,c)); cout<<"kattasi:"< a,b,c sonlari berilgan bu sonlarni o’sish tartibida joylashtirish algaritmini tuzing. #include #include using namespace std; int main() {
cin>>a>>b>>c; if(a>b && b>c){ cout< { cout<} if(b>a && a>c) { cout< if(b>c && c>a) { cout<} if(c>b && b>a) {cout<} if(c>a && a>b) { cout<} } a,b,c,d sonlari berilgan a soni b dan katta bo’lsa d bilan almashtiring aks xolda c bilan almashtiring. #include #include using namespace std; int main() { double a, b, c, d ; cin>>a>>b>>c>>d; if(a>b) cout< cout< x, y , z haqiqiy musbat sonlar berilgan. x, y, z uzunlikka ega tomonli uchburchak mavjudmi? #include #include using namespace std; int main() { double x, y, z ; cin>>x>>y>>z; if(x+y>z && y+z>x && x+z>y) cout<<"Ha , mumkin"; else cout <<"yo'q" ; } a soni berilgan bu son musbatmi, toq sonmi yoki no’lga tengligini tekshirish algaritmini tuzing. Uznligi a va b bo’lgan (a>b) kesma berilgan, b kesma a kesmada necha marta joylashishi mumkin. Uchta son berilgan shu sonlar orasida nechta musbat va nechta manfiy son bor. a soni berilgan, bu son tub sonligini aniqlovchi algaritm tuzing. Markazi (x,y) nuqtada bo’lgan aylana berilgan, aylana markazi koordinatalar o’qining qaysi choragida joylashgan #include #include using namespace std; int main() { double a, b ,c, x, q; cin>>a>>b>>c>>x; if (a*b!=0) { q=(a*x*x+pow(b*c , 1./3))/(2*a*b); cout<} else if(a>0) { q=(sin(x)*sin(x)+pow(b,3))/(log(a*x*x)); cout<} else cout<<"yoq"; } #include #include using namespace std; int main() { double a,b, c, x,y; cin>>a>>b>>c>>x; if(a<0) { y=(pow(sin(a*x),2)+pow(cos(a*x*x), 3))/(pow((a+b),2)+c); cout< else if(a*a>=b*b*b) { y=(sqrt(a*a-b*b)+2*a*c)/(sin(a)*sin(a)+b*x*x); cout< cout<<"yooooq"; } #include #include using namespace std; int main() { double a ,b, c, x ,q , y; cin>>a>>b>>c>>q>>x; if(a>c) {y=(2*pow(x,3)+a*x*x+pow(c,3))/(a*a-c*c); cout< else if(q!=0) { y= (2*a*b+sin(a*x*x))/sqrt(a*a+2*q*q); cout< else cout<<"shart bajarilmadi:"; } #include #include using namespace std; int main() { double a , b, c ,x , y ,d ; cin>>a>>b>>c>>d>>x; if (a>0) { y=(2*c*c+a*b*cos(x*x))/(a*sin(x*x)+pow(b,3)); cout< else if(d!=0) { y= (a*a+2*b*pow(c,3))/sqrt(pow(a,3)+2*c*c+pow(d,3)); } else cout<<"Bunday shartlar bajarilmadi:"; } 3-Takrorlanuvchi algaritmlar #include #include using namespace std; int main() { float x,n; cin>>n>>x; double s=0; for(int i=0 ; i<=n; i++) s+=(pow(-1 ,n-1)*pow((x-1),n))/n; cout<<"S="< return 0; } #include #include using namespace std; int main() { float x,n; cin>>n>>x; double p=0; for(int i=0 ; i<=n; i++) p+=(pow(-1,n)*pow(x, 2*n))/n; cout<<"P="< return 0; } #include #include using namespace std; int main() { float x,n; cin>>n>>x; double s=0; for(int i=0 ; i<=n; i++) s+=pow(-1,n)*pow(x, 2*n); cout<<"s="< return 0; } #include #include using namespace std; int main() { float x,n; cin>>n>>x; double s=0; for(int i=0 ; i<=n; i++) s+=(pow(-1,n-1)*pow(x, 2*n-1))/n; cout<<"s="< return 0; } #include #include using namespace std; int main() { float x,n; cin>>n>>x; double s=0; for(int i=0 ; i<=n; i++) s+=pow(x, 2*n-1)/n; cout<<"s="< return 0; } #include #include using namespace std; int main() { float x,n; cin>>n>>x; double p=0; for(int i=0 ; i<=n; i++) p+=(pow(x, 2*n-1)*pow(-1 ,n+1))/(2*n-1); cout<<"p="< return 0; } #include #include using namespace std; int main() { float x,n; cin>>n>>x; double s=0; for(int i=0 ; i<=n; i++) s+=pow(x, 2*n-1)/(2*n-1); cout<<"s="< return 0; } #include #include using namespace std; int main() { float n; cin>>n; double p=0; for(int i=0 ; i<=n; i++) p+=1/n; cout<<"p="< return 0; } #include #include using namespace std; int main() { float n, k; cin>>n>>k; double s=0; for(int i=0 ; i<=n; i++) s+=(pow(k,n))/n; cout<<"s="< return 0; } #include #include using namespace std; int main() { float n; cin>>n; double s=0; for(int i=0 ; i<=n; i++) s+=pow(M_PI,(2*n+1))/(pow(10 ,(2*n+1))); cout<<"s="< return 0; } #include #include using namespace std; int main() { float n; cin>>n; double s=0; for(int i=0 ; i<=n; i++) s+=M_PI/(pow(10 ,(2*n+1))); cout<<"s="< return 0; } , Download 406.13 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling