Alisher navoiy nomidagi samarqand davlat universiteti axborotlashtirish texnologiyalari
Download 5.01 Kb. Pdf ko'rish
|
- Bu sahifa navigatsiya:
- 26-variant a)
- 28-variant
- 30-variant
- Mavzu: Massiv elementlari bilan ishlash. Paskal tilida qism dastur. Topshiriqni bajarilish namunasi 1- vazifa
- Yo’q S:=0; I:=1 i:=i+1 Massiv elementlarini kiriting x[i]>0 Yo’q
- Yo’q i:=i+1 C ij :=0 j:=1 k3 Yo’q
- Yo’q Yo’q ha 279 4-vazifa.
- 2 – mustaqil ish topshiriqlari a) Bir o‘lchovli massiv elementlari bilan ishlash. b) Ikki o‘lchovli massiv elementlari bilan ishlash.
24 – variant a) 5 1 6 1 2 ) 1 2 ( 2 ! k j j k k P ni hisoblang. b) 1 k k x y x P ni eps = 0,001 aniqlik bilan hisoblang. c) m b l k b k a S 1 1 3 ni hisoblang 25 – variant a) 5 1 ! k k b a S ni hisoblang. b) 1 2 2 ... 3 4 2 n n S ni hisoblang. c) 3 1 5 1 ! ! i a i a P ni hisoblang 26-variant a) 5 1 12 1 3 2 n i i n S ni hisoblang. b) 1 2 л k x k S ni eps = 0,0001 aniqlik bilan hisoblang. 275 c) 5 1 8 1 3 2 ) ( n i i n S ni hisoblang 27-variant a) 4 2 3 10 1 2 2 2 i i a k k a i ai i P ni hisoblang. b) 1 dan n gacha toq sonlar kvadratlari yig’indisini hisoblang. c) 10 1 4 2 3 a i a k k S ni hisoblang. 28-variant a) 8 1 2 2 2 i a i ai i P ni hisoblang. b) [a,b] oraliqda m soniga karrali sonlar ko’paytmasini hisoblang c) 5 1 12 1 3 2 ) ( n i i n S ni hisoblang 29-variant a) Berilgan son raqamlari yig’indisini hisoblash dasturini tuzing. b) 2 dan 50 gacha 4 ga va 3 ga bo‘linadigan sonlarni chop eting. c) 3 1 5 1 ! ! i a i a P ni hisoblang 30-variant a) 12 1 3 6 1 2 i n i n S ni hisoblang. b) 1 dan 35 gacha bo‘lgan toq sonlar kvadratlarining yig‘indisi va juft sonlar kvadratlarining ko‘paytmasini toping c) 3 1 5 1 10 1 2 2 ) ( n k j n j k S ni hisoblang. 276 Mavzu: Massiv elementlari bilan ishlash. Paskal tilida qism dastur. Topshiriqni bajarilish namunasi 1- vazifa 20 2 1 ,..., , x x x massivning musbat elementlari yig‘indisini hisoblash algoritmi va dasturini tuzing. a) Masalani yechish algoritmi (blok-sxema). b) Masalani yechish dasturi. Program massiv; type n=1..20; var X:array [n] of real; i:integer; S:real; begin S:=0; for i:=1 to 20 do read(X[i]); if X[i]>= 0 then S:=S+X[i]; writeln(‘S=’,S); end. boshlash S ni chiqarish tamom ha i<:=20 Yo’q S:=0; I:=1 i:=i+1 Massiv elementlarini kiriting x[i]>0 Yo’q S:=S+x(i) ha 277 2 - vazifa Ikkita A(2,3) va B(3,3) matritsalar ko‘paytmasini hisoblash algoritmi va dasturini tuzing. Bu ko‘paytma quyidagi formula bilan hisoblanadi: m k k ik ij p j n i b a C ij 1 . ...... 2 , 1 , ....... 2 , 1 * a) masalani yechish algoritmi. b) Masalani yechish dasturi. Program matritsa; type mat=array[1..2,1..3] of real; mat2=array[1..3,1..3] of real; var A,C: mat; B: mat2; I,j, k : integer; begin for I; = 1 to 2 do for j:=1 to 3 do read (A [i,j]); readin; for i:=1 to 3 do for j:=1 to 3 do read (B [i,j]); for j:=1 to 2 do for j:= 1 to 3 do begin C [i,j]:=0; for k:=1 to 3 do C [i,j]:=C [i,j] + A [i,k]*B [k,j]; end for I;=1 to 2 do begin writeln; for i: = 1 to 3 do write (C[i,j]); end; end. boshlash ha jn Yo’q C ij :=C ij +a ik b bj j:=j+1 k:=k+1 a ik b kj, larni kiritish k:=1 C ij tamom ha ip Yo’q i:=i+1 C ij :=0 j:=1 k3 Yo’q ha i:=1 278 3 – vazifa Funksiya (function) dan foydalanib hisoblash algoritmi va dasturini tuz- ing. ) 1 2 ( ) 1 ( ) 2 , 2 ( 2 ) 1 ( 2 , 1 2 x x t x t x t S ; bu yerda 5 1 3 1 2 ) 1 ( ) ( i k k i x x t b) masalani yechish algoritmi. c) Masalani yechish dasturi. program ifoda; var x, s, p, p1, p2, p3: real; function TT (xx: real): real; var i, k: integer; t, t1: real; begin t=0; for I:=1 to 5 do begin t1:=0; for k:=1 to 3 do t1:=t1+SOR (xx+1)/(i+k); t=t+t1; end; TT:=t; end; begin readln(x); p:=TT* (1+x); p1:=TT* (2.2+x); p2:=TT* (Sqr(xx)-1)); p3:=TT* (2*x+1); S:=(1.2+p+2*p1)/(p2+p3;) writeln (‘S=’,S); end. X P:=t(1+x) P1:=t(2,2+x) P2:=t(x^2-1) P3:=t(2x+1) 1,2+p+2p1 S:= ------------ p2+p3 S ni chiqaring boshlash t:=0 i:=1 t1:=0 k:=1 tamom t:=t+t1 i:=i+1 t1:=t2+(x+1) 2 /(i+k) k:=k+1 k<3 k<5 ha Yo’q Yo’q ha 279 4-vazifa. Prosedura (procedure) dan foydalanib hisoblash dasturini tuzing. )! 1 * 2 ( )! 2 ( )! 1 ( )! 1 * 2 ( )! ( 2 m n n m n n m n S a) masalani yechish algoritmi. 2) Masalani yechish dasturi (Paskal tilida) program ifoda; var S, S1, S2, S3, S4, S5: real; m, n: integer; procedure FAK (L: integer; var p: real); var I:integer; begin p:=1; for i:=1 to L do p:=p*I; end; begin readln (n,m); FAK (n+m,S1); FAK (n*n+2*n-1,S2); FAK (m+n-1, S3); FAK (2+n, S4); FAK (2*m-1,S5); S:= (S1+S2) / (S3+S4+S5); writeln (‘S=’,S); end. n,m P:=1; I:=1 P:=P+I i:=i+1 S:=(P1+P2)/(P3+P4+P5) S ni chiqaring boshlash tamom ik k:=n+m k:=n^2+2n-1 k:=m+n+1 k:=2+n k:=2*m-1 P:=P1 P:=P2 P:=P3 P:=P4 P:=P5 280 2 – mustaqil ish topshiriqlari a) Bir o‘lchovli massiv elementlari bilan ishlash. b) Ikki o‘lchovli massiv elementlari bilan ishlash. c) Finction dan foydalanib dastur tuzish. d) Procedure dan foydalanib dastur tuzish. Ha bir talaba ushbu nazariy savollarning mazmunini yoritib, so’ngra o’z va- riantidagi amaliy topshiriqlarni bajaradi. 1-variant a) x 1 , x 2 , ….,x n sonlar berilgan. n k k x n M 1 1 va n k k M x n D 1 2 2 ) ) ( 1 1 ( ni hisoblang. b) A(10, 10) matritsaning bosh diagonalining eng katta elementini va u tur- gan ustunni aniqlang. c) y P y P y P y P U 2 1 2 1 1 , 0 1 2 , 3 , bu yerda 1 2 ! k k x x P . d) 1 , 3 , , 2 max , , , max 4 , 2 , 3 , min , , , min d c b a d c b a c b a d c b a U . 2-variant a) x 1 , x 2 , …,x 55 sonlar berilgan: x 1 (x 2 +x 3 ) (x 4 +x 5 +x 6 ) … (x 46 +x 47 +…,x 55 ) ni hisoblang. b) S(M,N) kvadrat matritsa bosh diagonalining barcha elementlarini, so‘ngra musbat va manfiy elementlarini yig‘indisini toping. c) a b c a c b b a c b a b a U 2 2 , 2 max , min , 2 max , min d) m n m n ЭКУБ m n m ЭКУБ n m ЭКУБ U , , , , 2 3-variant a) n elementdan iborat A massiv berilgan. Massiv elementlarini o‘sib borish tartibida joylashtiring. b) B(N,M) matritsa har bir ustuni elementlari yig‘indisini, so‘ngra har bir sa- tri elementlari ko‘paytmasini toping. c) 5 , 2 1 2 3 5 , 1 2 2 , 0 B x B x С С U , bu yerda 5 1 2 2 1 2 ; ! 4 2 n y y y B n y y C . d) ! 1 ! 3 ! ! 1 3 ! 2 2 2 2 m n n m nm n n m U 281 4-variant a) a 1 , a 2 ,…,a 55 massiv berilgan. Massiv elementlarining eng kattasini 1-soni bilan, eng kichigini esa -1 soni bilan almashtiring. b) A(N,M) har bir satrining eng katta elementini toping va ularning indeks tartib raqamini aniqlang. c) b a f b a f b a f U , 1 , , 2 2 2 , bu yerda hollarda an qo t u t u аgar t u t г аgar t u t u f lg , 0 , 0 , 0 , 0 , , 2 2 2 2 d) k m k n n m EKUB n m k n m EKUB m k n n m EKUB U , , , , , , 5-variant a) x 1 , x 2 ,…,x 20 massiv elementlarining eng kichik musbat elementining tartib nomerini aniqlang va undan keyin turgan elementlar sonini toping. b) A(N,M) matritsa har bir ustunining eng kichik elementlarini toping. c) b a f b a f b a f S , 1 , , 2 2 2 , bu yerda xollarda an qo t u t u agar t u t u agar t u t u f lg , 0 , 0 , 0 , 0 , , 2 2 2 2 d) N ta uchburchak o‘z tomonlari bilan berilgan. Bu uchburchaklar yuzlarini hisoblang va ulardan kattasini aniqlang. 6-variant a) m i n k i k x Z 1 1 2 sin , bu yerda x 1 , x 2 , … ,x m massiv berilgan. b) A(N,M) matrisa har bir satr elementlari yig‘indisini hisoblang va ulardan eng kattasi va eng kichigini toping. c) x y x f y x f b a f y x f Z , , 1 , , , bu yerda xollarda an qo t u u agar t u u agar t u t u f lg , 1 2 1 , 0 , 2 , 2 d) n ta uchburchakning uchlari koordinatalari bilan berilgan. Bu uchburchaklarning yuzlarini hisoblang va ulardan kichigini toping. 7-variant a) x 1 , x 2 ,…,x n massivning manfiy elementlarining eng kattasini toping. b) A(N,M) matritsa har bir ustuni elementlari ko‘paytmasini hisoblang. Ularning eng kichigi va kattasini aniqlang. 282 c) N k n m n m n m EKUB k m k n m n EKUB n n m n EKUB P , , , , , , , , , 2 2 d) n ta uchburchak o‘z tomonlari bilan berilgan. Bu uchburchaklarga ichki chizilgan aylana radiuslarini hisoblang va ularning kattasini aniqlang. 8-variant a) x 1 , x 2 , …,x n massivning manfiy, musbat va nol elementlarining sonini aniqlang. b) A(3,3) massiv berilgan. Uning satr elementlari yig’indisidan yangi bir o’lchovli massiv hosil qiling. c) ) 1 2 ( ) 1 2 ( ) 2 ( x P y P x P B ; bu yerda a a a P 2 ) 1 ( ) ( 2 . d) ). 2 , , max( ) , 2 , max( ) , , 2 max( z y x z y x z y x t 9-variant a) m k k n i i Y m x n S 1 1 1 1 ni hisoblang. b) A(3,3) massiv berilgan.Uning ustun elementlari yig’indisidan bir o’lchovli massiv hosil qiling. c) ) ( ln ) 1 2 ( 15 ) 5 , 0 ( x t x t e Z t ; bu yerda 1 3 2 ) ( 2 a a a t d) )! 2 ( )! 2 ( )! 2 ( ! 2 2 m n m n m n n t 10-variant a) x 1 , x 2 , …,x n massiv berilgan. Uning toq elementlaridan U, juft element- laridan Z massiv hosil qiling. b) B(3,3) massiv berilgan. Uning birinchi va uchinchi ustun elementlarini 3 ga ko‘paytirib yangi massiv hosil qiling. c) 1 6 10 ) 1 6 sin( ) 1 6 cos( 1 ) 1 6 ln( 2 2 2 2 x x t t z z y y y d) ). , , ( ) , , ( ) , , ( c b a EKUK z y x EKUK k n т EKUK T 5>3> Download 5.01 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling