1 solutions

  • 0
    @ 2025-11-5 17:33:01

    Pascal :

    var s,i,n,h:integer;
     a,b:array[1..100] of integer;
    begin
    readln(n);
    
    for i:=1 to  n do
      begin
      read(s);
       a[i]:= s;
       end;
     for i:=1 to n do begin
      if a[i]>0 then
      begin
      b[i]:=i;h:=h+1;if h=1 then write(a[i]) else write(' ',a[i]);
      end;
      end;
      writeln;
      h:=0;
      for i:=1 to n do
    
       if b[i]>0 then begin
        h:=h+1; if h=1 then write(b[i])else  write(' ',b[i]); end;
    
    end.
    
    
    • 1

    Information

    ID
    18548
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    (None)
    # Submissions
    0
    Accepted
    0
    Uploaded By