For:
- for , , ;
- -;
- - (, - integer).
Repeat:
- repeat , . . ;
- repeat , until, ;
- until ;
- repeat , ;
While:
- while , . . ;
- while , while, ;
- while ;
- while , ;
1. n. x n.
:
x | n | ||
:
: , .
1. , , (, x 4.)
Program x_v_stepeni_4;
var
x, y: real;
begin
Writeln(' x? ');
Readln(x);
y:=1; {x }
y:=y*x; {x }
y:=y*x; {x }
y:=y*x; {x }
y:=y*x; {x }
writeln('x 4 ',y);
Readln;
end.
2. ( n ), , .
Program x_v_stepeni_4;
var
x, y: real;
i, n: integer; {i - }
begin
Writeln(' x n ');
Readln(x,n); { For }
y:=1; { y:=1; }
i:=1;
while (i<=n) do { For i:=1 to n do }
begin { begin }
y:=y*x; { y:=y*x; }
i:=i+1;
end; { end; }
Writeln(' x n ', y);
Readln;
end.
i:=i+1. , For .
2. , 0. .
:
1. : 2 . .
|
|
Program Proizved_3_otricat_chisel;
var
x, p: real;
begin
: = 1;
Writeln(' x ');
Readln(x);
if x<0 then p:=P*x;
Writeln(' x ');
Readln(x);
if x<0 then p:=P*x;
writeln('P= ',p);
Readln;
end.
2. . , , , . ( x ).
Program Proizved_otricat_chisel;
var
x, p: real;
begin
P:=1;
Writeln(' x ');
Readln(x);
while (x<>0) do
begin
if x<0 then p:=P*x;
Writeln(' x ');
Readln(x);
End;
writeln(' P= ',p);
Readln;
end.
3. S=1+2+3+4+....+n.
1. : S=1+2+3+4.
Program Summa;
var
s, i: integer;
begin
s:=0; i:=1;
s:=s+i;
i:=i+1;
s:=s+i;
i:=i+1;
s:=s+i;
i:=i+1;
s:=s+i;
i:=i+1;
writeln(' S= ',s);
Readln;
end.
2. n-.
Program Summa;
var
s, i, j: integer;
begin
Writeln(' n ');
Reed(n);
s:=0; i:=1;
for j:=1 to n do
begin
s:=s+i;
i:=i+1;
end;
writeln(' S= ',s);
Readln;
end.
1 S=1+2+3+4+....+n.
2 6 .
3 , . .
4 . .
5 .
6 . .
7 , [,]. , , .
8 exp x cos x
Exp x = 1 + x + x2/2! + x3/3! + ,
cos x = 1 - x2/2! + x4/4! - x6/6! + x8/8! - .
. e=0.0001. exp cos x.
9 n. S=1+1/(1*2)+1/(1*2*3)+....+1/(n!)
10 =x x1 x2, H=0.01.
11 6 .
12 n. n.
13 n. ?
14. n. n?
15. , m n.
16. 6 . .
17. 7 . .
18. , .
19. . , .
|
|
6.
: .
:
¾ , ;
¾ ;
¾ , .
:
1. , , .
2. .
3. : [4: 7.1 7.3], [7: 10, 16], [8: 4].
4. .
5. .
: 4 5 1 3.