pascal排序(删除+双排)拜托各位大神

一、pascal 排序(删除+双排)拜托各位大神

{我自己写了个程序,用集合做的,应该很快了,互相交流下:} program ex; type e=set of 1..100; w=record num:integerarray[1..100]of w; var i,j,n,p,q:integer;a,b:z;c:array[1..100]of bnction max®:e; begin max:=[]; if k[l then max:=max+[l] else if k[l]hen max:=max+[:=max+[l,m]; end; begin rea1to n do begin read(a[i].num,b[r(c,sizeof©,false); en n-1do for j:=i+1to n do begin a[i].pos:=a[i]i,j); b[i].pos:=b[i].pos,j); end; j:=0; for i:=1to n do begin a[i].pos:=a[i].pos-[i]; b[i].pos:=b[i].pos-[i]; if a[i].pos*b[i].pos=[] then begin inc(j); c[id; end; writeln(j); for i:=1to 100dteln(a[i].num,’ ‘,b[i].num); end.

pascal排序(删除+双排)拜托各位大神

二、pascal排序怎么写

program l;

var a:array[1..10] of integer;

i,j,t:integer;

begin

for i:=1 to 10 do

read(a[i]);

for i:=1 to 9 do

for j:=1+1 to 10 do

if a[i]>a[j] then begin t:=a[i]; a[i]:=a[j]; a[j]:=t;

for i:=1 to 10 do

write(a[i],’ ‘);

end.

procedure kp(l,r:longint);

var i,j,x,t:longint;

begin

i:=l;j:=r;x:=a[(l+r) div 2];

repeat

while a[i]

while x

if i<=j then begin t:=a[i];a[i]:=a[j];a[j]:=t;inc(i);dec(j);end;

until i>j;

if i

end;

三、pascal排序(删除+双排)

{我自己写了个程序,用集合做的,应该很快了,互相交流下:}

program ex;type e=set of 1..100; w=record num:integer; pos:e; end; z=array[1..100]of w;var i,j,n,p,q:integer;a,b:z;c:array[1..100]of boolean;function max(k:z;l,m:integer):e;beginmax:=[];if k[l].num>k[m].num then max:=max+[l]else if k[l].num

本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。