比赛 noip_6 评测结果 WWAAWA
题目名称 打保龄球 最终得分 50
用户昵称 WaterFire 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-10-08 21:11:01
显示代码纯文本
program waterfire;
const
fin='bowling.in';
fout='bowling.out';
var
i,j,mark,code,p,s,x1,x3,x2,l,t:longint;
ss:string;
f,g:text;
all,data:array[1..10] of longint;

procedure ten;
begin
data[i]:=10;
if ss[2]='/' then
 begin
   if ss[3]='/' then inc(data[i],20)
     else begin
             val(ss[3],x3,code);
             inc(data[i],10+x3);
           end;
 end else begin
            if ss[3]='/' then inc(data[i],10)
               else begin
                      val(ss[3],x3,code);
                      val(ss[2],x2,code);
                      data[i]:=data[i]+x2+x3;
                     end;
           end;
 delete(ss,1,1);
 end;

procedure num;
begin
if ss[2]='/' then
  begin
  data[i]:=10;
  if ss[3]='/' then inc(data[i],10)
    else begin
           val(ss[3],x3,code);
           data[i]:=data[i]+x3;
         end;
  end else  begin
           val(ss[1],x1,code);
           val(ss[2],x2,code);
           data[i]:=data[i]+x2+x1;
          end;
delete(ss,1,2);
end;
Procedure print(x:longint);
 var
 ii,jj:longint;
 begin
  if ss[x]='/' then ten
    else num;
 end;
BEGIN
s:=1;p:=1;
assign(f,fin);reset(f);
assign(g,fout);rewrite(g);
read(f,ss);l:=length(ss);
for i:=l downto 1 do
  if ss[i]=' ' then delete(ss,i,1);
  l:=length(ss);
  for i:=1 to 10 do
  print(1);
for i:=1 to 10 do
 for j:=i downto 1 do
  all[i]:=all[i]+data[j];
  for i:=1 to 9 do
  write(g,data[i],' ');
  writeln(g,data[10]);
  for i:=1 to 9 do
  write(g,all[i],' ');
  write(g,all[10]);
  close(f);close(g);
END.