讨论 / 蛋疼,第五个点怎么搞的
Fish、のTorres 2011-03-01 20:01:00
点我顶贴 收藏 删除
var a:array[1..50]of longint;

k,s,n,i,j,t,r:longint;

begin

readln(n);

for i:=1 to n do read(a[i]);

for i:=i+1 to 50 do a[i]:=maxlongint;

for k:=1 to n-1 do begin

for i:=1 to n-k+1 do begin

for j:=i+1 to n-k+2 do begin

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

end;

end;

if k=1 then s:=a[1];

a[1]:=a[1]+a[2];

s:=s+a[1];

a[2]:=maxlongint;

end;

writeln(s);

t:=0;

for i:=2 to s div 2 do begin

if s mod i=0 then begin t:=1;break;end;

end;

if t=1 then writeln('Yes') else writeln('No');

end.

查看更多回复
提交回复