应该是这样,不对在说
program fsd;
var
a,b:array[1..100] of integer;
n,i,x,y,t,j,k:integer;
begin
readln(n);
for i:=1 to n do read(a[i]);
read(x,y);
t:=1;
for j:=1 to n do begin
k:=j;
if a[j]=x then while k<=n do if a[k]<>y then begin
b[t]:=a[k];
inc(t);
inc(k);
end else begin b[t]:=a[k];inc(t);break;end;
end;
read(x,y);
for j:=1 to n do begin
k:=j;
if a[j]=x then while k<=n do if a[k]<>y then begin
b[t]:=a[k];
inc(t);
inc(k);
end else begin b[t]:=a[k];inc(t);break;end;
end;
for i:=1 to t-1 do write(b[i],' ');
end.
本文如未解决您的问题请添加抖音号:51dongshi(抖音搜索懂视),直接咨询即可。