Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var n,k0,km,x,i,min,c : integer;
  2. begin
  3. readln(n);
  4. c:=0;
  5. min:= 10000;
  6. km:=0;
  7. k0:=0;
  8. for i:=1 to n do begin
  9. readln(x);
  10. if x=0 then k0:=i;
  11. if x<0 then begin
  12. inc(c);
  13. if abs(x)<min then begin
  14. min:= abs(x);
  15. km:=i;
  16. end;
  17. end;
  18. end;
  19. writeln(c);
  20. writeln(k0);
  21. writeln(km);
  22. for i:=1 to n do
  23. if ((c mod 2 = 1) and (i<> k0)) then if (i<> km) then write(i,' ')
  24.  
  25. else if (i<> k0) then write(i,' ');
  26. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement