sfasf

Var
k:char;
x1,y1,x2,y2,i,numx1,numx2,numy1,numy2,l1,l2:longint;
a,b:array[1..1000,1..2]of longint;
Begin
assign(input,'1.in');reset(input);
read(k);
while k<>'E' do
begin
if k='W' then
begin
inc(x1);
if (x1>=11) and (x1-y1>=2) then
begin
inc(numx1);
inc(l1);
a[l1,1]:=x1; a[l1,2]:=y1;
x1:=0; y1:=0;
end;
inc(x2);
if (x2>=21) and (x2-y2>=2) then
begin
inc(numx2);
inc(l2);
b[l2,1]:=x2; b[l2,2]:=y2;
x2:=0; y2:=0;
end;
end
else
begin
inc(y1);
if (y1>=11) and (y1-x1>=2) then
begin
inc(numy1);
inc(l1);
a[l1,1]:=x1; a[l1,2]:=y1;
x1:=0; y1:=0;
end;
inc(y2);
if (y2>=21) and (y1-x1>=2) then
begin
inc(numy2);
inc(l2);
b[l1,1]:=x2; b[l2,2]:=y2;
x2:=0; y2:=0;
end;
end;
read(k);
end;
for i:=1 to l1 do
writeln(a[i,1],':',a[i,2]);
writeln(numx1,':',numy1);
writeln;
for i:=1 to l2 do
writeln(b[i,1],':',b[i,2]);
writeln(numx2,':',numy2);
readln;
close(input);
End.

0 条评论

目前还没有评论...

信息

ID
1409
难度
4
分类
贪心 点击显示
标签
递交数
7957
已通过
3118
通过率
39%
被复制
17
上传者