- 丢失的筷子
- 2009-11-04 12:56:27 @
program exe;
var n,i,s,j:integer;
a,b:array[1..1000]of integer;
begin
read(n);s:=0;
for i:=1 to n do read(a[i]);
for i:=1 to n do b[i]:=0;
for i:=1 to n do
for j:=1 to n do
if a[i]=a[j] then b[i]:=b[i]+1;
for i:=1 to n do if b[i]=1 then s:=a[i];
write(s);
end.
1 条评论
-
Jay-Chan LV 5 @ 2010-04-05 09:05:12
取值范围太小了。
- 1