Subscribe: RSS | Comment          Snow: Toggle | Change Wind
Insert AdSense Ads Here
Home

1

十二

2014庐阳区信息学竞赛第2题-group

Posted by 窦学文
Filed under 解题
 

var
a,i,j,f,t:longint;
b:array[1..1000000]of longint;
begin
assign(input,’group.in’);
assign(output,’group.out’);
reset(input);
rewrite(output);
read(a);
for i:=1 to a do
read(b[i]);
for i:=1 to a-1 do
for j:=1 to a-i do
if b[j]>b[j+1] then begin t:=b[j]; b[j]:=b[j+1]; b[j+1]:=t; end;
for i:=b[1] downto 1 do
begin
f:=0;
for j:=1 to a do
if b[j] mod i 0 then f:=1;
if f=0 then begin write(i); break; end;
end;
close(input);
close(output);
end.

Tags:
merry christmas
0
 

Leave a Reply

In collaboration with Bingo Sites, Free Bingo and Foxy Bingo.
Designed by