Showing Page:
1/4
Вариант 26
- 1 -
Лабораторная работа №1
program lab1;
uses crt;
var x,y,z,q,u1,u2,u3,u4: real;
begin
clrscr;
writeln('Vvedite x,y,z,q');
readln(x,y,z,q);
u1:=exp(ln(3)*exp(ln(4)*x*y))+exp(x*y*ln(4))+exp(-z*q);
writeln('u1=',u1:7:2);
writeln('Vvedite x');
readln(x);
u2:=sqrt(sqr(x)+1)+sqr(arctan(ln(abs(x))/sqrt(1-sqr(ln(abs(x))))));
writeln('u2=',u2:7:2);
writeln('Vvedite x,y');
readln(x,y);
u3:=exp(1/5*ln((x+4*y)/3/x))-(x+2)/2/sin(x);
writeln('u3=',u3:7:2);
writeln('Vvedite x');
readln(x);
u4:=(exp(3*ln(abs(sin(2*x))))+3*sqr(cos(exp(-x))))/(x+5*cos(x)/sin(x));
writeln('u4=',u4:7:2);
readkey;
end.
Результаты счета:
Vvedite x,y,z,q
1 1 2 3
u1= 85.00
Vvedite x
0.5
u2= 1.70
Vvedite x,y
3 3
u3= -16.61
Vvedite x
0.2
u4= 0.06
Лабораторная работа №2
program lab2;
uses crt;
var t,a,b,c,d,x,x1,x2: real;
begin
clrscr;
write('Vvedite t=');
readln(t);
a:=t-3;
b:=-5*t;
c:=3*t-3;
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=3
yravnenie imeet odin koren x= 0.40
Vvedite t=1
korni yravnenia x1= 0.00 x2= -2.50
Vvedite t=0
yravnenie deistvitelnih kornei ne imeet
Showing Page:
2/4
Вариант 26
- 2 -
Лабораторная работа №3 часть 1
а) (x>-5)and(x<20)
б) ((x>-1)and(x<=3))or((x>7)and(x<=13))
Лабораторная работа №3 часть 2
program lab3_2;
uses crt;
var x,y,z: real;
begin
clrscr;
writeln('Vvedite x,y,z');
readln(x,y,z);
if((y+2*z)/2)<(x-y-z)then u:= (y+2*z)/2
else u:= x-y-z;
writeln('ishodnie dannie x=',x:5:1,' y=',y:5:1,' z=',z:5:1);
writeln(‘u=min((y+2x)/2,x-y-z)=’ ,u:5:2);
readkey
end.
Результаты счета:
Vvedite x,y,z
1 5 0
ishodnie dannie x=1.0 y= 5.0 z= 0
u= min((y+2x)/2,x-y-z)= -4
Лабораторная работа №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/((2*k-1)*k*2);
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.0492|
--------------------
| 0.3000| -0.1433|
--------------------
| 0.4000| -0.1884|
--------------------
| 0.7000| -0.3176|
--------------------
| 1.0000| -0.4376|
--------------------
Showing Page:
3/4
Вариант 26
- 3 -
Лабораторная работа №5
program lab5;
uses crt;
const nmax=30;
var
C,pol,ost: array[1..nmax] of real;
n,kpol,kost,i: 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,C[i]);
writeln(fout,'kolichestvo elementov v massive C=',n:3);
writeln(fout,'ishodnii massiv C');
for i:=1 to n do write(fout,C[i]:7:2);
writeln(fout);
kpol:=0;
kost:=0;
for i:=1 to n do
begin
if C[i]>0then
begin
kpol:=kpol+1;
pol[kpol]:=C[i];
end
else begin
kost:=kost+1;
ost[kost]:=C[i];
end;
end;
for i:=1 to kpol do C[i]:=pol[i];
for i:=1 to kost do C[i+kpol]:=ost[i];
writeln(fout,'pereformirovanni massiv C');
for i:=1 to n do write(fout,C[i]:7:2);
writeln(fout);
close(finp);
close(fout);
writeln('konec rashcheta'); readkey
end.
Результаты счета:
kolichestvo elementov v massive C= 10
ishodnii massiv C
-15.00 5.00 -34.00 -13.00 14.00 -0.20 0.80 4.00 18.00 -78.00
pereformirovanni massiv C
5.00 14.00 0.80 4.00 18.00 -15.00 -34.00 -13.00 -0.20 -78.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 Bq Ar Ar
Вычисляем x Bq y Ar z x y scal z y
x
−−
= = = = = =
= = =


=

( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( )
1.6 4 1.6 0.8 1 1.1 2 3.4
0.8 0 1.6 0.8 4 1.1 3 6.5
1.1 1 1.6 0.8 1 1.1 1 0.3
1 2 3 0.7 1 0.7 1.3 2 0.2 3
2) 1 2 1 1.3 1 0.7 1.3 2 0.2 1
3 2 0 0.2 3 0.7 1.3
y
+ +


= + + =


+ +

+ +
= = + +
+
( )
2.5
2.1
2 0.2 0 0.5
3.4 2.5 5.9 5.9 2.5
3) 6.5 2.1 4.4 4) ( , ) 4.4 2.1 = -5.9*2.5+4.4*2.1-0.2*0.5 = -5.61
0.3 0.5 0.2 0.2 0.5
z s Bq Ar Ar




=




+


= = = =
−−
Showing Page:
4/4
Вариант 26
- 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,q,x,n); mult(A,r,y,n); lin(x,y,z,1,-1,n); s:=scal(z,y,n);
writeln(fout,'Rezultat: s=(Bq-Ar,Ar)=',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=(Bq-Ar,Ar)= -5.61

Unformatted Attachment Preview

Name: Description: ...
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