主题:help me!!
.program program3;
var c: array[1..3] of string[200];
s: array[1..10] of integer;
m, n, i: integer;
procedure numara;
var cod: boolean;
i, j, nr: integer;
begin
for j := 1 to n do begin
nr := 0; cod := true;
for i := 1 to m do
if c[i, j] = '1' then begin
if not cod then begin
cod := true; inc(s[nr]); nr := 0;
end
end
else begin
if cod then begin
nr := 1; cod := false;
end
else inc(nr);
end;
if not cod then inc(s[nr]);
end;
end;
begin
readln(m, n);
for i := 1 to m do readln(c[i]);
numara;
for i := 1 to m do
if s[i] <> 0 then write(i, ' ', s[i], ' ');
end.
"这个J的值是从1到N一直循环,从这个循环开始后J的值就不为0 "
那么n是多少呢???
你输入n是多少从头到尾n都不变
n根本没有定它的值!!!
var c: array[1..3] of string[200];
s: array[1..10] of integer;
m, n, i: integer;
procedure numara;
var cod: boolean;
i, j, nr: integer;
begin
for j := 1 to n do begin
nr := 0; cod := true;
for i := 1 to m do
if c[i, j] = '1' then begin
if not cod then begin
cod := true; inc(s[nr]); nr := 0;
end
end
else begin
if cod then begin
nr := 1; cod := false;
end
else inc(nr);
end;
if not cod then inc(s[nr]);
end;
end;
begin
readln(m, n);
for i := 1 to m do readln(c[i]);
numara;
for i := 1 to m do
if s[i] <> 0 then write(i, ' ', s[i], ' ');
end.
"这个J的值是从1到N一直循环,从这个循环开始后J的值就不为0 "
那么n是多少呢???
你输入n是多少从头到尾n都不变
n根本没有定它的值!!!