. , , ,

,,,

 

1.

2.

3.

4.

5.

6.


1.

z, x y. x y , a b k m.

:

Program pr_1;

var x,y,z,a,b:real;

const k=1; m=2;

begin

writeln('Vvedite a');

readln(a);

writeln('Vvedite b');

readln(b);

x:=a*k-(k*sqr(sqr(b))*b)/(1.2+sqr(sin(a+b)));

y:=(1+sqr(sin(a/2)/cos(a/2))/((a/(a+b)+2.1)*ln(m)/ln(10)));

z:=m*exp(ln(x)*y)+2*k*x*y-0.81;

writeln('x = ',x:5:2);

writeln('y = ',y:5:2);

writeln('z = ',z:5:2);

end.

:

2.

A, B, C. X, Y, Z. . D1 D2 , U X Y. U . .

:

Program pr_2;

var

A,B,C,X,Y,Z,U:real;

begin

writeln('Vvedite A');

read(A);

writeln('Vvedite B');

read(B);

writeln('Vvedite C');

read(C);

X:=A+B;

if X>A+C then X:=A+C;

if X>B+C then X:=B+C;

Y:=A;

if Y<2*B then Y:=2*B;

if Y>3*C then Y:=3*C;

Z:=X/Y;

if ((X>=-3) and (X<=-2)) and ((Y<=1) and (Y>=-2)) then

begin

U:=ln(X+Y)/ln(10);

end

else

if X*X+Y*Y<=1*1 then

begin

U:=X-Y+Z;

end

else U:=1;

writeln('U = ',U:5:2);

end.

:

3.

z=f(x,y) . x y x. x. hx y. y. hy . . x,y,z.

while, repeat.

:

Program pr_3;

var

i,j:integer;

x,xn,xk,hx,y,yn,yk,hy,z:real;

begin

writeln('Vvedite nachalnoe znachenie x');

read(xn);

writeln('Vvedite konechnoe znachenie x');

read(xk);

writeln('Vvedite shag izmeneniya znacheniya x');

read(hx);

writeln('Vvedite nachalnoe znachenie y');

read(yn);

writeln('Vvedite konechnoe znachenie y');

read(yk);

writeln('Vvedite shag izmeneniya znacheniya y');

read(hy);

writeln('x y z');

x:=xn;

while x<=xk

do

begin

y:=yn;

repeat

z:=(2*sqr(x)*x+cos(y)/sin(y))/sqrt(1+ln(sqr(y))/ln(10));

writeln(x:5:2,' ',y:5:2,' ',z:5:2);

y:=y+hy;

until y>yk;

x:=x+hx;

end;

readln;

end.

:

4.

.

(3,4) m . (3,4)

(i=1,,3; j=1,,4)

.

:

Program pr_4;

var

i,j,m:integer;

A,B: array [1..3,1..4] of real;

max:real;

begin

writeln('Vvod matrici po strokam');

for i:=1 to 3 do

begin

for j:=1 to 4 do

begin

writeln('Vvedite element matrici');

readln(A[i,j])

end;

end;

m:=0;

j:=2;

while j<=4 do

begin

for i:=1 to 3 do

begin

if A[i,j]>0 then m:=m+1;

end;

j:=j+2;

end;

for i:=1 to 3 do

begin

for j:=1 to 4 do

begin

if m=0 then B[i,j]:=A[i,j]

else B[i,j]:=A[i,j]/m;

end;

end;

max:=abs(A[1,j]);

for j:=1 to 4 do

begin

if max<abs(A[1,j]) then max:=abs(A[1,j]);

end;

writeln('Matrica A');

for i:=1 to 3 do

begin

writeln('');

for j:=1 to 4 do

begin

write(A[i,j]:5:0);

end;

end;

writeln('');

writeln('Matrica B');

for i:=1 to 3 do

begin

writeln('');

for j:=1 to 4 do

begin

write(B[i,j]:5:2);

end;

end;

writeln('');

writeln('m = ',m);

writeln('maksimalniy po modulyu element pervosy stroki ', max:5:0);

readln;

end.

:

5.

(7,7) (5,5). , D . , PROCEDURE. .

: .

:

Program pr_5;

type mas=array[1..7,1..7] of integer;

mas2=array[1..3] of integer;

var

A,B: mas;

C,D: mas2;

Procedure FillArr(var a:mas; row, col: integer);

var i,j:integer;

begin

for i := 1 to row do

for j := 1 to col do readln(a[i,j]);

end;

Procedure ActArr(var a:mas; count1,count2: integer; b:mas2);

var i,j,S,k:integer;

begin

k:=1;

for j:=2 to count1 do

begin

S:=0;

for i:=1 to count2 do S:=S+sqr(a[i,j*2-2]);

b[k]:=S;

k:=k+1;

end;

end;

Procedure OutputArr(var a:mas2; col: integer);

var i:integer;

begin

for i:=1 to col do write(a[i]:5);

end;

begin

writeln('Vvod matrici A'); fillarr(A, 7, 7);

writeln('Vvod matrici B'); fillarr(B, 5, 5);

ActArr(A,4,7,C);

ActArr(B,3,5,D);

writeln('Massiv C');

OutputArr(C, 3); writeln;

writeln('Massiv D');

OutputArr(D,2);

readln;

end.

:

6.

f. f . g.

: , . , .

:

Program pr_6;

var

f,g:text;

s:string;

i,k:integer;

begin

assign(f,'C:\text.txt');

reset(f);

assign(g,'C:\text2.txt');

rewrite(g);

while not eof(f) do

begin

k:=0;

readln(f,s);

for i:=1 to length(s) do

begin

if s[i]=',' then

begin

k:=i+1;

break;

end;

end;

if k<>0 then

begin

for i:=k to length(s) do

begin

write(g,s[i]);

end;

writeln(g,'');

end

else

writeln(g,'');

end;

close(f);

close(g);

readln

end.

:

1. 2. 3. 4. 5.

 

 

 

! , , , .
. , :