Насте

 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
var
sum, min, c: integer;
a: integer; p, z: boolean;
count, b, tmp: byte;
BEGIN
count:=0; sum:=0; min:=32767;
write('-> ');
repeat
read(c); sum:=sum+c;
if (c<min) then min:=c;
a:=abs(c); p:=false; z:=false;
repeat
b:=a mod 10; a:=a div 10;
if not(p) then
begin
tmp:=b; p:=true;
end else
begin
if (b<tmp) then z:=true
else z:=false;
tmp:=b; p:=false;
end;
until (a=0);
if z then count:=count+1;
until (c=0);
writeln('min: ', min);
writeln('sum: ', sum);
writeln('cou: ', count);
END.