Showing Page:
1/4
Вариант 30
- 1 -
Лабораторная работа №1
program lab1;
uses crt;
var p,x,y,z,a,b,u1,u2,u3,u4: real;
begin
clrscr;
writeln('Vvedite p,x,y,z ');
readln(p,x,y,z);
u1:=exp((exp(x*y*(ln(abs(z)))))*ln(abs(p)))+exp(-sqr(x)/2)+1.2*abs(x);
writeln('u1=',u1:7:2);
writeln('Vvedite x,z,a');
readln(x,z,a);
u2:=exp(sin(x)+sin(x)/cos(x))+3*a*abs(ln(z));
writeln('u2=',u2:7:2);
writeln('Vvedite x, a, b, z');
readln(x,a,b,z);
u3:=(sqrt(sqr(x)+sqr(sin(exp(3*ln(abs(x))))))-4.3)/(2*x+8*a*b*exp(1/3*ln(abs(z))));
writeln('u3=',u3:7:2);
writeln('Vvedite x, a');
readln(x, a);
u4:=arctan(sqrt(1-7*sqr(x))/sqrt(1-1+7*sqr(x)))/32/a;
writeln('u4=',u4:7:2);
readkey;
end.
Результаты счета:
Vvedite p,x,y,z
1 2 1 1
u1= 3.54
Vvedite x,z,a
2 1 2
u2= 0.28
Vvedite x, a, b, z
1 2 1 2
u3= -0.14
Vvedite x, a
0.1 2
u4= 0.02
Лабораторная работа №2
program lab2;
uses crt;
var t,a,b,c,d,x,x1,x2: real;
begin
clrscr;
write('Vvedite t=');
readln(t);
a:=2*t+2;
b:=3*t;
c:= 3-2*t;
if(a=0)then
begin x:=-c/b;
writeln('yravnenie imeet odin koren x=',x:6:2);
readkey;
end;
d:=sqr(b)-4*a*c;
if d<0 then writeln('yravnenie deistvitelnih kornei ne imeet')
else begin
x1:=(-b+sqrt(d))/2/a;
x2:=(-b-sqrt(d))/2/a;
writeln('korni yravnenia x1=',x1:6:2,'x2=',x2:6:2);
readkey;
end;
end.
Результаты счета:
Vvedite t=-1
yravnenie imeet odin koren x= 1.67
Vvedite t=1.5
korni yravnenia x1= 0.00 x2= -0.90
Vvedite t=0.5
yravnenie deistvitelnih kornei ne imeet
Лабораторная работа №3 часть 1
а) (x>=8)and(x<=13)
б) ((x>-15)and(x<-8))or((x>=-2)and(x<2))
Showing Page:
2/4
Вариант 30
- 2 -
Лабораторная работа №3 часть 2
program lab3_2;
uses crt;
var x,y,z,u1,u: real;
begin
clrscr;
writeln('Vvedite x,y,z');
readln(x,y,z);
if (x+y-z)/5<sqr(y) then u1:=(x+y-z)/5
else u1:=sqr(y);
if(5+2*x)>u1 then u:=5+2*x
else u:=u1
writeln('ishodnie dannie x=',x:5:1,' y=',y:5:1,' z=',z:5:1);
writeln('rezultat u=max(5+2x,min(y*y,(x+y-z)/5))=',(u+1):5:1);
readkey
end.
Результаты счета:
Vvedite x,y,z
2 3 -1
ishodnie dannie x= 2.0 y= 3.0 z= -1.0
rezultat u= u=max(5+2x,min(y*y,(x+y-z)/5))= 9
Лабораторная работа №4
program lab4;
uses crt;
const p=' ';
line='---------------------';
var x,xk,s: real;
n,k,i,znak: integer;
f1:text;
begin
clrscr;
assign(f1,'summa.dat');
rewrite(f1);
write('Vvedite n=');
readln(n);
writeln(f1,p,line);
writeln(f1,p,'!',p,p,p,p,'x',p,p,p,p,'!',p,p,p,p,'s',p,p,p,p,'!');
writeln(f1,p,line);
for i:=1 to 5 do
begin
write('vvedite ocherednoe znachenie x=');
readln(x);
znak:=-1; s:=0; xk:=x;
for k:=1 to n do
begin
s:=s+znak*xk/sqr(k);
znak:=-znak;
xk:=xk*x;
end;
writeln(f1,p,'!',x:9:4,'!',s:9:4,'!');
writeln(f1,p,line);
end;
close(f1); readkey
end.
Результаты счета(файл summa.dat)
--------------------
| x | S |
--------------------
| 0.1000| -0.0976|
--------------------
| 0.3000| -0.2801|
--------------------
| 0.4000| -0.3658|
--------------------
| 0.7000| -0.6051|
--------------------
| 1.0000| -0.8180|
--------------------
Лабораторная работа №5
program lab5;
uses crt;
const nmax=10;
var
Showing Page:
3/4
Вариант 30
- 3 -
A,B,K: array[1..nmax] of real;
i,n: integer;
finp,fout: text;
begin
clrscr;
assign(finp,'lab5.inp'); reset(finp);
assign(fout,'lab5.out'); rewrite(fout);
readln(finp,n);
for i:=1 to n do read(finp,A[i]);
writeln(fout,'kolichestvo elementov v massive A=',n:3);
writeln(fout,'ishodnii massiv A');
for i:=1 to n do write(fout,A[i]:7:2);
writeln(fout);
for i:=1 to n do read(finp,B[i]);
writeln(fout,'kolichestvo elementov v massive B=',n:3);
writeln(fout,'ishodnii massiv B');
for i:=1 to n do write(fout,B[i]:7:2);
writeln(fout);
for i:=1 to n do
begin
if A[i]>B[i] then
begin
K[i]:=1;
end;
if A[i]<B[i] then
begin
K[i]:=0;
end;
end;
writeln(fout,'kolichestvo elementov v massive K=',n:3);
writeln(fout,'Pereformirovanni massiv K');
for i:=1 to n do write(fout,K[i]:7:2);
writeln(fout);
close(finp);
close(fout);
writeln('konec rashcheta'); readkey
end.
Результаты счета (файл lab5.out)
kolichestvo elementov v massive A= 5
ishodnii massiv A
15.00 5.00 2.00 13.00 14.00
kolichestvo elementov v massive B= 5
ishodnii massiv B
2.00 0.80 0.00 18.00 -13.30
kolichestvo elementov v massive K= 5
Pereformirovanni massiv K
1.00 1.00 1.00 0.00 1.00
Лабораторная работа 6. Вычисление скалярного произведения. Алгоритм и ручной счет:
1 2 3 4 1 2 0.1 1.6 0.7
: 1 2 1 0 4 3 1.7 0.8 1.3 : ( , )
3 2 0 1 1 1 1.5 1.1 0.2
1.) 2.) 3.) 4.) ( , )
4 1 2
1.) 0 4 3
111
Дано A B p q r Вычислить s BBr Aq
Вычисляем x Br y Bx z Aq scal z y
x
−−
= = = = = =
= = =


=



( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( )
0.7 4 0.7 1.3 1 0.2 2 1.1
1.3 0 0.7 1.3 4 0.2 3 5.8
0.2 1 0.7 1.3 1 0.2 1 0.8
4 1 2 1.1 4 1.1 5.8 1 0.8 2
2) 0 4 3 5.8 0 1.1 5.8 4 0.8 3
1 1 1 0.8 1 1.1 5.8 1
y
+ +


= + + =


+ +

+ +
= = + +
+ +
( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
3
25.6
0.8 1 5.5
1 2 3 1.6 1 1.6 0.8 2 1.1 3 3.3
3) 1 2 1 0.8 1 1.6 0.8 2 1.1 1 1.1
3 2 0 1.1 3 1.6 0.8 2 1.1 0 3.2
3.3 3
4) ( , ) 1.1 2
3.2
z
s BBr Aq




=






+ +


= = + + =


+ +



= =



5.6 3.3*3+1.1*25.6-3.2*5.5 = 20.46
5.5


=



Showing Page:
4/4
Вариант 30
- 4 -
program lab6;
uses crt;
const nmax=10;
type matr=array[1..nmax,1..nmax] of real;
vec=array[1..nmax] of real;
var a,b:matr; p,q,r,x,y,z:vec;
s:real; i,j,n:integer; finp,fout:text;
procedure mult(a:matr; var b,c:vec; n:integer);
var i,j:integer;
begin
for i:=1 to n do
begin c[i]:=0; for j:=1 to n do c[i]:=c[i]+a[i,j]*b[j]; end;
end;
procedure lin(var a,b,c:vec; ka,kb:real; n:integer);
var i:integer;
begin for i:=1 to n do c[i]:=ka*a[i]+kb*b[i]; end;
function scal(var a,b:vec; n:integer):real;
var i:integer; s:real;
begin s:=0; for i:=1 to n do s:=s+a[i]*b[i]; scal:=s; end;
begin
clrscr;
assign(finp,'lab6.inp'); reset(finp);
assign(fout,'lab6.out'); rewrite(fout);
readln(finp,n);
for i:=1 to n do
begin for j:=1 to n do read(finp,a[i,j])end;
for i:=1 to n do
begin for j:=1 to n do read(finp,b[i,j]) end; writeln(fout,'Poryadok matric =',n:3);
writeln(fout,'Matrx A');
for i:=1 to n do begin
for j:=1 to n do write(fout,a[i,j]:7:2); writeln(fout); end;
writeln(fout,'Matrix B');
for i:=1 to n do begin
for j:=1 to n do write(fout,b[i,j]:7:2); writeln(fout); end;
writeln(fout,'Vektor p') ;
for i:=1 to n do
begin read(finp,p[i]); write(fout,p[i]:7 :2) ; end;
writeln(fout);
writeln(fout,'Vektor q');
for i:=1 to n do
begin read(finp,q[i]); write(fout,q[i]:7 :2) ; end;
writeln(fout);
writeln(fout,'Vektor r');
for i:=1 to n do
begin read(finp,r[i]); write(fout,r[i]:7:2) ; end;
writeln(fout) ;
mult(b,r,x,n); mult(b,x,y,n); mult(A,q,z,n); s:=scal(y,z,n);
writeln(fout,'Rezultat: s=(BBr,Aq)=',s:8:3);
close(finp); close(fout); writeln('konec rashcheta'); readkey end.
Результаты счета(файл lab6.out)
Poryadok matric = 3
Matrx A
1.00 2.00 3.00
1.00 2.00 1.00
3.00 2.00 0.00
Matrix B
4.00 1.00 2.00
0.00 4.00 3.00
1.00 1.00 1.00
Vektor p
0.10 1.70 -1.50
Vektor q
-1.60 0.80 1.10
Vektor r
-0.70 1.30 0.20
Rezultat: s=(BBr,Aq)= 20.46

Unformatted Attachment Preview

Вариант 30 -1Лабораторная работа №1 program lab1; uses crt; var p,x,y,z,a,b,u1,u2,u3,u4: real; begin clrscr; writeln('Vvedite p,x,y,z '); readln(p,x,y,z); u1:=exp((exp(x*y*(ln(abs(z)))))*ln(abs(p)))+exp(-sqr(x)/2)+1.2*abs(x); writeln('u1=',u1:7:2); writeln('Vvedite x,z,a'); readln(x,z,a); u2:=exp(sin(x)+sin(x)/cos(x))+3*a*abs(ln(z)); writeln('u2=',u2:7:2); writeln('Vvedite x, a, b, z'); readln(x,a,b,z); u3:=(sqrt(sqr(x)+sqr(sin(exp(3*ln(abs(x))))))-4.3)/(2*x+8*a*b*exp(1/3*ln(abs(z)))); writeln('u3=',u3:7:2); writeln('Vvedite x, a'); readln(x, a); u4:=arctan(sqrt(1-7*sqr(x))/sqrt(1-1+7*sqr(x)))/32/a; writeln('u4=',u4:7:2); readkey; end. Результаты счета: Vvedite p,x,y,z 1 2 1 1 u1= 3.54 Vvedite x,z,a 2 1 2 u2= 0.28 Vvedite x, a, b, z 1 2 1 2 u3= -0.14 Vvedite x, a 0.1 2 u4= 0.02 Лабораторная работа №2 program lab2; uses crt; var t,a,b,c,d,x,x1,x2: real; begin clrscr; write('Vvedite t='); readln(t); a:=2*t+2; b:=3*t; c:= 3-2*t; if(a=0)then begin x:=-c/b; writeln('yravnenie imeet odin koren x=',x:6:2); readkey; end; d:=sqr(b)-4*a*c; if d<0 then writeln('yravnenie deistvitelnih kornei ne imeet') else begin x1:=(-b+sqrt(d))/2/a; x2:=(-b-sqrt(d))/2/a; writeln('korni yravnenia x1=',x1:6:2,'x2=',x2:6:2); readkey; end; end. Результаты счета: Vvedite t=-1 yravnenie imeet odin koren x= 1.67 Vvedite t=1.5 korni yravnenia x1= 0.00 x2= -0.90 Vvedite t=0.5 yravnenie deistvitelnih kornei ne imeet Лабораторная работа №3 часть 1 а) (x>=8)and(x<=13) б) ((x>-15)and(x<-8))or((x>=-2)and(x<2)) -2- Лабораторная работа №3 часть 2 program lab3_2; uses crt; var x,y,z,u1,u: real; begin clrscr; writeln('Vvedite x,y,z'); readln(x,y,z); if (x+y-z)/5u1 then u:=5+2*x else u:=u1 writeln('ishodnie dannie x=',x:5:1,' y=',y:5:1,' z=',z:5:1); writeln('rezultat u=max(5+2x,min(y*y,(x+y-z)/5))=',(u+1):5:1); readkey end. Результаты счета: Vvedite x,y,z 2 3 -1 ishodnie dannie x= 2.0 y= 3.0 z= -1.0 rezultat u= u=max(5+2x,min(y*y,(x+y-z)/5))= 9 Лабораторная работа №4 program lab4; uses crt; const p=' '; line='---------------------'; var x,xk,s: real; n,k,i,znak: integer; f1:text; begin clrscr; assign(f1,'summa.dat'); rewrite(f1); write('Vvedite n='); readln(n); writeln(f1,p,line); writeln(f1,p,'!',p,p,p,p,'x',p,p,p,p,'!',p,p,p,p,'s',p,p,p,p,'!'); writeln(f1,p,line); for i:=1 to 5 do begin write('vvedite ocherednoe znachenie x='); readln(x); znak:=-1; s:=0; xk:=x; for k:=1 to n do begin s:=s+znak*xk/sqr(k); znak:=-znak; xk:=xk*x; end; writeln(f1,p,'!',x:9:4,'!',s:9:4,'!'); writeln(f1,p,line); end; close(f1); readkey end. Результаты счета(файл summa.dat) -------------------| x | S | -------------------| 0.1000| -0.0976| -------------------| 0.3000| -0.2801| -------------------| 0.4000| -0.3658| -------------------| 0.7000| -0.6051| -------------------| 1.0000| -0.8180| -------------------- Лабораторная работа №5 program lab5; uses crt; const nmax=10; var Вариант 30 -3- A,B,K: array[1..nmax] of real; i,n: integer; finp,fout: text; begin clrscr; assign(finp,'lab5.inp'); reset(finp); assign(fout,'lab5.out'); rewrite(fout); readln(finp,n); for i:=1 to n do read(finp,A[i]); writeln(fout,'kolichestvo elementov v massive A=',n:3); writeln(fout,'ishodnii massiv A'); for i:=1 to n do write(fout,A[i]:7:2); writeln(fout); for i:=1 to n do read(finp,B[i]); writeln(fout,'kolichestvo elementov v massive B=',n:3); writeln(fout,'ishodnii massiv B'); for i:=1 to n do write(fout,B[i]:7:2); writeln(fout); for i:=1 to n do begin if A[i]>B[i] then begin K[i]:=1; end; if A[i]
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4