税收

program chdjmf;
var
  x : integer;
  y : real;
begin
  read(x);
  if x < 0 then
    writeln(' input error.:(...')
  else
  begin
    if x >= 10000 then y := x*0.05
    else if x >= 5000 then y := x*0.03
    else if x >= 2000 then y := x*0.02
    else if x >= 1000 then y := x*0.01
    else y := 0;
    writeln(y:0:2);
  end;
end.

===================================== OR ================================================

program chdjmf;
var
  x, z : integer;
  y : real;
begin
  read(x);
  z := x div 1000;
  case z of
    9, 8, 7, 6, 5: y := x*0.03;
    4, 3, 2: y := x*0.02;
    1: y := x*0.01;
    0: y := x*0;
    else y := x*0.05;
  end;
  writeln(y:0:2);
end.

===================================== OR ================================================

program chdjmf;
var
  x : integer;
  y : real;
begin
  read(x);
  case x of
    0..1000-1: y := 0;
    1000..2000-1: y := x*0.01;
    2000..5000-1: y := x*0.02;
    5000..10000-1: y := x*0.03;
    else y := x*0.05;
  end;
  writeln(y:0:2);
end.
posted @ 2010-01-01 18:30  SmartIOI  阅读(120)  评论(0)    收藏  举报
本站采用CC授权如需转载、引用文章,请务必附上作者及来源处。 Creative Commons License