עכשיו ראיתי את התגובות ..
מה שיצא לי זה ככה..:-/
Program AR;
TYPE x=array of integer;VAR i,SUM,SUMB,SUMA,bun,NO:integer;
a:x;
B:x;
FUNCTION numbair(num:integer;a:x):integer;
BEGIN
Begin
FOR I:=1 TO 20 DO
BEGIN
Begin
IF num=a then {*}SUM:=SUM+1
END;
END;
FOR I:=1 TO 20 DO
BEGIN
IF SUM>0 THEN
IF num>a then
SUMA:=SUMA+1
ELSE
END;
BEGIN
writeln('This is the number of the numbers that appear BEFORE NUM : ',SUMA);
END;
Begin
for i:=1 to 20 do
begin
if num<>a then NO:=NO+1
end;
begin
if NO>0 then
if num>a then SUMB:=SUMB+1
end;
end;
writeln('This is the number of the numbers that appear IN ALL THE ARRAY: ',SUMB);
End;
END;
{End of function}
BEGIN
SUMA:=0;
SUM:=0;
SUMB:=0;
NO:=0;
writeln('Please insert 20 numbers to the array');
FOR i:=1 TO 20 DO
begin
readln(a);
end;
writeln('Please insert 10 numbers that you want to check');
FOR I:=1 TO 20 DO
begin
readln(bun);
writeln('This the solution for THIS NUMBER! : ',numbair(bun,a));
end;
END.