usaco Broken Necklace 求查错//usaco 1.1.4 Broken Necklaceprogram usaco114;vari,n,tot,max:longint;a:array[1..1200] of char;procedure init;beginreadln(n);for i:=1 to n do beginread(a[i]);a[i+n]:=a[i];a[i+n+n]:=a[i];end;end;procedure xzs(i:integer);b

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 11:54:29
usaco Broken Necklace 求查错//usaco 1.1.4 Broken Necklaceprogram usaco114;vari,n,tot,max:longint;a:array[1..1200] of char;procedure init;beginreadln(n);for i:=1 to n do beginread(a[i]);a[i+n]:=a[i];a[i+n+n]:=a[i];end;end;procedure xzs(i:integer);b
xSN0~oMHHSvx*֎ZF&XHH !o N_ b~EA8b q8_ٶrngm@@Xu'&5}4tz M\ Ѩ- Ve:"AǀPM,9FajTw[ H d`uWZ)eb3+1<5<6&/}@z! ]G|Kti HiFTs5 SUYYlwF&WE%ׁ@)V:, `$qj2J7 MFEto7)@c>Bc a:dfRpi65ey-9\݉,ս?/oϷi:~_'ѳzk,

usaco Broken Necklace 求查错//usaco 1.1.4 Broken Necklaceprogram usaco114;vari,n,tot,max:longint;a:array[1..1200] of char;procedure init;beginreadln(n);for i:=1 to n do beginread(a[i]);a[i+n]:=a[i];a[i+n+n]:=a[i];end;end;procedure xzs(i:integer);b
usaco Broken Necklace 求查错
//usaco 1.1.4 Broken Necklace
program usaco114;
var
i,n,tot,max:longint;
a:array[1..1200] of char;
procedure init;
begin
readln(n);
for i:=1 to n do begin
read(a[i]);
a[i+n]:=a[i];
a[i+n+n]:=a[i];
end;
end;
procedure xzs(i:integer);
begin
repeat
if (a[i]=a[i-1]) or (a[i-1]='w') then
tot:=tot+1;
until ((a[i]a[i-1]) and (a[i-1]'w'));
end;
procedure xys(i:integer);
begin
repeat
if ((a[i]=a[i+1]) or (a[i+1]='w')) then
tot:=tot+1;
until ((a[i]a[i+1]) and (a[i+1]'w'));
end;
procedure search;
begin
tot:=0;
max:=0;
for i:=n to 2*n+1 do begin
xys(i);
xzs(i);
if max

usaco Broken Necklace 求查错//usaco 1.1.4 Broken Necklaceprogram usaco114;vari,n,tot,max:longint;a:array[1..1200] of char;procedure init;beginreadln(n);for i:=1 to n do beginread(a[i]);a[i+n]:=a[i];a[i+n+n]:=a[i];end;end;procedure xzs(i:integer);b
procedure xzs(i:integer);
begin
repeat
if (a[i]=a[i-1]) or (a[i-1]='w') then
tot:=tot+1;
until ((a[i]a[i-1]) and (a[i-1]'w'));
end;
procedure xys(i:integer);
begin
repeat
if ((a[i]=a[i+1]) or (a[i+1]='w')) then
tot:=tot+1;
until ((a[i]a[i+1]) and (a[i+1]'w'));
end;
i没有改变,变成死循环