-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDIDEJI.PAS
40 lines (38 loc) · 863 Bytes
/
DIDEJI.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
program the_reflecting_god;
uses crt;
var seka: array [1..100] of integer;
tiesa: array [1..100] of boolean;
a,b,c,d,e:integer;
label 1;
begin
clrscr;
checkbreak:=false;
c:=-maxint;
writeln('kiek ivesi?');
1: read(a);
if a>100 then
begin
writeln ('Vesk is naujo, zioply!');
goto 1;
end;
for b:= 1 to a do
begin
read (seka[b]);
end;
writeln;
write('skaiciai mazejimo tvarka: ');
for e:=1 to a do begin
for b:= 1 to a do
begin
if (seka[b]>c) and (not tiesa[b]) then
begin
c:=seka[b];
d:=b;
end;
end;
write(seka[d],' ');
tiesa[d]:=true;
c:=-maxint;
end;
readkey;
end.