Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. const nmax=100;
  2. type vector=array[1..nmax] of integer;
  3.  
  4. var
  5.  
  6. a:vector;
  7. n,i,max:integer;
  8.  
  9. begin
  10.  
  11. read(n);
  12.  
  13. for i:=1 to n do
  14. read(a[i]);
  15.  
  16. for i:=1 to n do
  17. if(a[i] mod 2 = 0) then
  18. max:=a[i];
  19.  
  20. for i:=1 to n do
  21. if(a[i] mod 2 = 0) and (a[i]>max) then
  22. max:=a[i];
  23.  
  24. write(max);
  25.  
  26. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement