fork download
  1. program ideone;
  2. const
  3. N=6;
  4. var
  5. a: array [1..N] of integer;
  6. x, i,y,k: integer;
  7. begin
  8. y:=MaxInt;
  9. for i:= 1 to N do
  10. readln(a[i]);
  11.  
  12. for i:=1 to N-1 do
  13. begin
  14. x:=a[i]+a[i+1];
  15. if (x mod 2 <> 0) and (x < y) then
  16. y := x;
  17. end;
  18.  
  19. writeln(y)
  20. end.
Success #stdin #stdout 0s 328KB
stdin
4
2
3
6
1
2
stdout
3