program z1;
var a: array [1..15] of real;
i, k, b: integer;
proizv: real;
begin
proizv:= 1;
a[1]:= 0.01;
a[2]:= -3;
a[3]:= 0;
a[4]:= 1.25;
a[5]:= -371;
a[6]:= 0.5;
a[7]:= -0.1;
a[8]:= 1.2;
a[9]:= -5;
a[10]:= -172.3;
a[11]:= 19783;
a[12]:= -2.7;
a[13]:= 43.51;
a[14]:= 0;
a[15]:= -0.02;
b:= -3;
k:= 0;
for i:=1 to 15 do
begin
if (a[i] <> 0) and (a[i] > b) then
begin
proizv:= proizv * a[i];
k:= k+1;
end;
end;
writeln('Количество чисел, подходящих условию: ', k);
writeln('Произведение чисел, подходящих условию: ', proizv);
end.
Объяснение:
На фото нарисована блок-схема, она немного криво сфоткана, надеюсь разберёшься. Если есть вопросы - задавай :)
|
/a,b,c/
| - +
< a>b and a>c > - /a/
| - + |
< b>c > /b/
| - |
/c/(konec)
(начало)
|
/a,b,c,d,e/
| - +
< a>b and a>c and a>d and a>e> - /a/
| - + |
< b>c and b>d and b>e > /b/
| - + |
< b>d and b>e > - /c/
| - + |
< d>e > /d/
| - |
/d/(konec)
(nachalo)
|
/a,b,c/
| +
< a=b and b=c >/'Wse starshe wseh'/
| - + + |
< a=b >< a > c >/'A u B starshe C'/
| | - |
| +/'C starshe wseh'/
| - + + |
< b=c >< b > a >/'B u C starshe A'/
| | - |
| +/'A starshe wseh'/
| - + + |
< a=c >< a > b >/'A u C starshe B'/
| | - |
| +/'B starshe wseh'/
| - + |
< a>b and a>c > /'A starshe wseh'/
| - + |
< b>c > /'B starshe wseh'/
| - |
/'C starshe wseh'/(konec)