记录编号 80054 评测结果 AAAAA
题目名称 [NOI 1998]个人所得税 最终得分 100
用户昵称 Gravatar正确率超低的渣渣 是否通过 通过
代码语言 Pascal 运行时间 0.009 s
提交时间 2013-11-06 18:32:48 内存使用 5.53 MiB
显示代码纯文本
  program personaltax (input,output);
  var
  m,bh,mm,i,j:longint;
  aa,order,aaa,aaaa:char;
  b:array[0..50001,0..13] of real;
  ans,x:real;

     function incomme (x:real):real;
     var
     income:real;
     begin
     if x<=4000  then   x:=x-800
                 else   x:=x*0.8;
     income:=0.0;

     if x<0 then BEGIN   incomme:=income; exit;   END;


     if x<=20000 then begin income:=income+x*0.2;
                            Incomme:=income;
                            exit;
                      end;
     x:=x-20000.0;
     income:=income+4000.0;


     if x<=30000 then begin income:=income+x*0.3;
                             incomme:=income;
                            exit;
                      end;
     x:=x-30000.0;
     income:=income+9000.0;

     income:=income+x*0.4;
     incomme:=income;
     end;


     function payy (x:real):real;
     var
     pay:real;
     begin
     x:=x-800;
     pay:=0.0;
      if x<0 then BEGIN   payy:=pay; exit;  END;


     if x<=500 then begin pay:=pay+x*0.05;
                             payy:=pay;
                           exit;
                      end;
     x:=x-500;
     pay:=pay+25;

     if x<=1500 then begin pay:=pay+x*0.10;
                             payy:=pay;
                           exit;
                      end;
     x:=x-1500;
     pay:=pay+150;

     if x<=3000 then begin pay:=pay+x*0.15;
                          payy:=pay;
                           exit;
                      end;
     x:=x-3000;
     pay:=pay+450;

     if x<=15000 then begin pay:=pay+x*0.20;
                              payy:=pay;
                            exit;
                      end;
     x:=x-15000;
     pay:=pay+3000;

     if x<=20000 then begin pay:=pay+x*0.25;
                              payy:=pay;
                            exit;
                      end;
     x:=x-20000;
     pay:=pay+5000;

     if x<=20000 then begin pay:=pay+x*0.30;
                            payy:=pay;
                            exit;
                      end;
     x:=x-20000;
     pay:=pay+6000;

     if x<=20000 then begin pay:=pay+x*0.35;
                              payy:=pay;
                            exit;
                      end;
     x:=x-20000;
     pay:=pay+7000;

     if x<=20000 then begin pay:=pay+x*0.40;
                              payy:=pay;
                            exit;
                      end;
     x:=x-20000;
     pay:=pay+8000;

     pay:=pay+x*0.45;
     payy:=pay;
     end;

  begin
  assign(input,'personaltax.in');
  reset(input);
  assign(output,'personaltax.out');
  rewrite(output);

  readln(m);
  ans:=0;

  read(order);
  repeat
  if order='P' then begin
                    read(aa);read(aa);
                    read(bh);read(aa);

                    read(aaa);
                    while aaa =' ' do read(aaa);
                    read(aaaa);
                    if aaaa ='/' then  mm:=ord(aaa)-48
                                 else  begin
                                       mm:=(ord(aaa)-48)*10+(ord(aaaa)-48);
                                       read(aaaa);
                                       end;
                    read(aaa);
                    read(aaaa);

                    readln(x);
                    b[bh,mm]:=b[bh,mm]+x;
                    end;

  if order='I' then begin
                    read(aa);read(aa);read(aa);read(aa);read(aa);
                    read(bh);read(aa);
                    read(aaa);

                     while aaa =' ' do read(aaa);

                    read(aaaa);
                    if aaaa ='/' then  mm:=ord(aaa)-48
                                 else  begin
                                       mm:=(ord(aaa)-48)*10-(ord(aaaa)-48);
                                       read(aaaa);
                                       end;
                    read(aaa);
                    read(aaaa);

                    readln(x);
                    ans:=ans+incomme(X);
                    end;
  read(order);
  until  order='#';
  for i:=1 to m do
  for j:=1 to 12 do
  if b[i,j]>800 then
  ans:=ans+payy(b[i,j]);

  writeln(ans:0:2);

  close(input);
  close(output);
 end.