Вы находитесь на странице: 1из 11

,

.
PASCAL :
1.
2.
3.

() FOR
WHILE
REPEAT

FOR

FOR I :=n1 to n2 do
I (), ;
n1 n2 - .
,
.
,
, .

FOR
1. n1, n2;
2. n1;
3. n2,
;
4. ;
5. 1,
3.

FOR I :=n1 to n2 do
n2 - n1 + 1

, , n2 ,
, . ,
:
n := 10;
For i := 1 to n do
Begin
Write (i);
n := 100;
End;
10 ,
100.
: ?
1.

FOR i :=-10 to -4 do

2.
3.

FOR i:=6 to 2 do
FOR i :=3 to 3 do

1 ,
10, 9, 8, 7, 6, 5, 4, 7 .
2 ,
.
3 1 , 3.
,
,
.
: , .
1.
2.
3.
4.
5.

FOR i := 2 to 20 do
Writeln(i);
FOR i:= 2 to 20 do
i:=i+1;
FOR i := 2 to 20 do
Readln (i);
FOR i:= 2 to 20 do
A:=i*i;

1, 3 4. 2
.

-
: .
,
(, 20 25: 20, 21, 22, 23, 24, 25).
. .
1. :

FOR I :=n1 to n2 do

2.

FOR I :=n2 downto n1 do

for.

: y2 (y=1,2,,10)

Program KWADRAT;
Uses crt;
Var kw, y: integer;
Begin
Clrscr;
For y:=1 to 10 do
Begin
kw:= sqr(y);
Writeln (y:3,kw:5);
End;
Writeln;
For y:=10 downto 1 do
Begin
kw:=sqr(y);
Writeln (y:3,kw:5);
End;
Readln;
End.

:=1,10

Y,kw

:= 10,1

Kw:=sqr(y)
Kw:=sqr(y)

Y,kw

program min;
uses crt;
var i:integer;
x,y : real;
begin
clrscr;
writeln ('Enter first');
readln (x);
for i:=2 to 20 do
begin
write ('Enter next');
readln (y);
if y<x then x:= y
end;
writeln ('min=',x:6:2);
readln;
end.

: 20 ,
:

:= 2,20

Y
Y

:=Y

Y<
+

: ,

program Summa;
uses crt;
var I, n :integer;
x, sum : real;
begin

n ,

clrscr;
writeln (Enter n);
readln (n);
sum:=0;
for i:=1 to n do
begin
write (Enter x);
readln (x);
sum:=sum+ x;
end;
writeln (sum=, sum:6:2);
readln;
end.

: ,
n (0<n18) .
Program Chisla;
uses crt;
var n, i, k, p1, p2:integer;
begin
clrscr;
k:=0;
writeln (Vvesti n);
readln (n);
for i:=10 to 99 do
begin
p1:=i div 10;
p2:= i mod 10;
if (p1+ p2) =n then
begin
writeln (i);
k:=k+1;
end;
end;


c
-.
WHILE
REPEAT
?
?
?
?
?
,
1. ;
2. 1.

, (
)

1.
2.
3.

While ,
Repeat .
Repeat ,
While .
While , , Repeat
.
Repeat Until Begin
End, Whiledo ;
Begin End.

While Repeat


While
: a, b (a > 1). a,
a2, a3, an an <b

a, a2, a3 .
, b.

program Stepeny_a;
Uses Crt;
var a,b,c : real;
begin
writeln ( a b );
readln ( a, b );
c := a;
while c < b do
begin
writeln (c:8:2) ;
c := c*a;
end;
readln;
end.

, 7.
,
, , -
.
( ) .
Program Kratn_7;
Uses Crt;
Var k: integer;
Begin
Clrscr;
k:=14;
While k<=99 do
Begin
Writeln(k);
k:=k+7;

end;
readln;
end.


, ,
, -
. ( )
.
:
10?


, 0. :
1. .
2. .

Repeat

, 1 9
5 .
:
1. Random.
2. 1 5 ,
.
3. ,
Repeatuntil.
Program Ugaday_chislo;
const Npop=5;
var comp, igrok, n: integer;
Begin
Randomize;
comp:=random(9)+1;
Writeln ('Game " " ');
Writeln ( 1 9);
Writeln ( ');
Writeln ( 5 ');
repeat
n:=n+1;
Write ( - ');
readln(igrok);
until (n=npop) or (comp=igrok);
if comp = igrok
then Writeln ('Win')
else Writeln (' No win Chislo - ',comp);
readln; end.
x>0
.
:
, , y,
=x.
- y 10
R- y 10
K- - x
y
10. x.
y: y
10. ,
1. y
1.


1. FOR?
2. WHILE?
3. REPEAT?
4. WHILE REPEAT.

While Repeat.
.
WHILE.

, .

x2 [0,1]
0.1. 8 .
( Repeat)

,
. Random.
5 ,
.
3- For, While
Repeat.

Оценить