MoonlyDays

Untitled

May 18th, 2020
1,085
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program A1;
  2. var A: array[1..8] of integer;
  3.     B: array[1..10] of integer;
  4.    
  5. function sum(a: integer):integer;
  6. begin
  7.     sum:=a+1;
  8. end;
  9.  
  10. procedure fill;
  11. var i: integer;
  12. begin
  13.     for i:=1 to 8 do
  14.     begin
  15.         A[i]:=sum(i);
  16.         write(A[i], ' ');
  17.     end;
  18.     writeln;
  19.     for i:=1 to 10 do
  20.     begin
  21.         B[i]:=sum(i);
  22.         write(A[i], ' ');
  23.     end;
  24.     writeln;
  25. end;
  26.  
  27. procedure find;
  28. var i,j: integer;
  29. begin
  30.     for i:=1 to 8 do
  31.         if (A[i] > 5) then
  32.             j:=j+1;
  33.     writeln('A = ',j);
  34.     j:=0;
  35.     for i:=1 to 10 do
  36.         if (B[i] > 5) then
  37.             j:=j+1;
  38.     writeln('B = ',j);
  39. end;
  40.  
  41. begin
  42.     fill;
  43.     find;
  44. end.
RAW Paste Data