pascal程序错误

[复制链接]
查看11 | 回复2 | 2010-8-6 10:46:22 | 显示全部楼层 |阅读模式
var
a,b,c:array[1..10000] of integer;
n,i,j,t:longint;
begin
readln(n);
for i:=1 to n do
read a;
for i:=1 to n-1 do
begin
for j:=i+1 to n do
begin
if a:=a[j];
then b[a]:=b[a]+1;
end;
end;
for i:=1 to n do
c:=b;
for i:=1 to n do
begin
for j:=1 to n do
begin
if b<b[j] then
begin
t:=b[j];
b[j]:=b;
b:=t;
end;
end;
end;
for i:=1 to n do
begin
if c:=b[1]
then writeln(i,' ',b[1]+1);
end;
end.
无法运行,请问哪里错了

回复

使用道具 举报

千问 | 2010-8-6 10:46:22 | 显示全部楼层
read a中a未加()if a:=a[j];中删去:和;if c:=b[1]中删去:
回复

使用道具 举报

千问 | 2010-8-6 10:46:22 | 显示全部楼层
你最好用free pascal 它会告诉你哪一行哪一个地方错的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行