fork download
  1. program ideone;
  2. var
  3. x : array [1..8] of integer = (8, 33, 46, 78, 92, 229, 399, 433);
  4. y : array [1..8] of integer = (5, 24, 43, 67, 78, 133, 269, 375);
  5. z : array [1..8] of integer = (7, 13, 27, 46, 52, 68, 78, 109);
  6. p1 : integer = 1;
  7. q1 : integer = 1;
  8. r1 : integer = 1;
  9.  
  10. begin
  11. while not ((x[p1]=y[q1]) and (y[q1]=z[r1])) do begin
  12. if x[p1]<y[q1] then begin
  13. p1:=p1+1;
  14. end else if y[q1]<z[r1] then begin
  15. q1:=q1+1;
  16. end else if z[r1]<x[p1] then begin
  17. r1:=r1+1;
  18. end else begin
  19. end;
  20. end;
  21. {x[p1] = y[q1] = z[r1]}
  22. writeln (x[p1]);
  23. end.
Success #stdin #stdout 0s 9136KB
stdin
Standard input is empty
stdout
78