From c8185f580f71fb0b8279401fa9b13c7f84895a5a Mon Sep 17 00:00:00 2001 From: lwms Date: Fri, 3 May 2002 01:25:11 +0000 Subject: *** empty log message *** git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@144 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/cal.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/cal.c b/mbbsd/cal.c index c3d2303f..6853ec64 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -1,4 +1,4 @@ -/* $Id: cal.c,v 1.6 2002/05/02 06:41:46 lwms Exp $ */ +/* $Id: cal.c,v 1.7 2002/05/03 01:25:11 lwms Exp $ */ #include #include #include @@ -368,11 +368,12 @@ void mail_redenvelop(char* from, char* to, int money, char mode){ /* ­pºâÃØ»Pµ| */ int give_tax(int money) { - int tax = 0, tax_rate; - static int tax_bound[] = { 1000000, 100000, 10000, 1000}; - for( tax_rate = 0; tax_rate <= 3; tax_rate++ ) - if ( money >= tax_bound[tax_rate] ) break; - tax = money * ( 0.5 - tax_rate/10.0 ); + int i, tax = 0; + static int tax_bound[] = { 1000000, 100000, 10000, 1000, 0}; + static double tax_rate[] = { 0.4, 0.3, 0.2, 0.1, 0.05 }; + for( i = 0; money < tax_bound[i]; i++ ) + ; + tax = money * tax_rate[i]; return tax <= 0 ? 1 : tax; } -- cgit v1.2.3