比赛 |
noip_6 |
评测结果 |
AAAWWW |
题目名称 |
打保龄球 |
最终得分 |
50 |
用户昵称 |
zxc111 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2008-10-08 21:40:10 |
显示代码纯文本
program ooo;
var
i,j,k,n,m,l:longint;
t:text;
a:array[0..10000] of char;
b:array[0..10000,1..2] of longint;
c,d,e:array[0..10000] of longint;
begin
assign(t,'bowling.in');
reset(t);
while not eof(t) do
begin
inc(i);
read(t,a[i]);
end;
close(t);
n:=i;
j:=0;
k:=1;
a[0]:=' ';
for i:=1 to n do
if a[i]=' ' then begin inc(k);j:=0;end else
begin
inc(j);
if a[i]='/' then if a[i-1]=' ' then b[k,j]:=10 else b[k,j]:=10-b[k,1] else
b[k,j]:=ord(a[i])-ord('0');
inc(e[k]);
end;
m:=k;
for i:=1 to m do
begin
if (b[i,1]=10)or(b[i,1]+b[i,2]=10) then
begin
l:=0;
j:=0;
for j:=i to m do
begin
if l=3 then break;
for k:=1 to 2 do
if l=3 then break else
if b[j,k]<>0 then
begin
inc(l);
c[i]:=c[i]+b[j,k];
end;
end;
if l<3 then c[i]:=0;
end;
if b[i,1]+b[i,2]<10 then
c[i]:=b[i,1]+b[i,2];
end;
for i:=1 to m do
if c[i]=0 then break else
d[i]:=d[i-1]+c[i];
assign(t,'bowling.out');
rewrite(T);
if m>10 then m:=10;
for i:=1 to m do
if (i=10)or(c[i+1]=0) then break else write(t,c[i],' ');
if (c[i]<>0) then write(t,c[i]) ;
writeln(t);
for i:=1 to m do
if (i<>10)and(d[i+1]<>0) then write(t,d[i],' ') else break;
if d[i]<>0 then
write(t,d[i]);
close(t);
end.