ac1036.pas
来自「同济大学 Online在线题库 AC源代码合集 程序设计竞赛必看资料」· PAS 代码 · 共 29 行
PAS
29 行
program tju1036;
const
maxcount=1528;
var
q:array[0..maxcount]of qword;
p1,p2,p3,f1,f2,f3,r,i:integer;
a,b,c:qword;
begin
repeat
read(p1,p2,p3,i);
if p1>p2 then begin r:=p1;p1:=p2;p2:=r;end;
if p1>p3 then begin r:=p1;p1:=p3;p3:=r;end;
if p2>p3 then begin r:=p2;p2:=p3;p3:=r;end;
f1:=0;f2:=0;f3:=0;r:=0;a:=p1;b:=p2;c:=p3;
repeat
if (a<=b) and (a<=c) then begin
if a>q[r] then begin inc(r);q[r]:=a;end;inc(f1);a:=q[f1]*p1;
end
else if b<=c then begin
if b>q[r] then begin inc(r);q[r]:=b;end;inc(f2);b:=q[f2]*p2;
end
else begin
if c>q[r] then begin inc(r);q[r]:=c;end;inc(f3);c:=q[f3]*p3;
end;
until r=i;
writeln(q[i]);
until seekeof;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?