1 条题解

  • 0
    @ 2025-4-12 22:06:18

    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

    信息

    ID
    2936
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    (无)
    递交数
    0
    已通过
    0
    上传者