Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.68 KB | None | 0 0
  1. Program 5375;
  2. var i, n, k_oz, a, i_oz, i0, m_oz: integer;
  3. Begin
  4.     readln(n);
  5.     k_oz := 0;
  6.     i_oz := 0; i0 := 0;
  7.     for i := 1 to n do
  8.     begin
  9.         readln(a);
  10.         if (a < 0) then
  11.         begin
  12.             if (k_oz = 0) then
  13.             begin
  14.                 m_oz := a;
  15.                 i_oz := i;
  16.             end;
  17.             if (a > m_oz) then
  18.             begin
  19.                 m_oz := a;
  20.                 i_oz := i;
  21.             end;
  22.             inc(k_oz);
  23.         end;
  24.         if (a = 0) then i0 := i;
  25.     end;
  26.     for i:= 1 to n do
  27.     begin
  28.         if (not((k_oz mod 2 <> 0) and (i = i_oz) or (i = i0))) then
  29.             writeln(i);
  30.     end;
  31. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement