不是VIP会员,不能显示答案

题目解答

题目:
program program4 ;
var c:array[1..2] 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],' ');
read(i);
end.
输出:1 12588 2 12337 3 12339
考点:
分析:
解答:
评论:
老师: