diff options
author | lwms <lwms@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-05-03 09:25:11 +0800 |
---|---|---|
committer | lwms <lwms@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-05-03 09:25:11 +0800 |
commit | c8185f580f71fb0b8279401fa9b13c7f84895a5a (patch) | |
tree | 45cb76c8c1a204b9223a400b61805a7758f4d517 | |
parent | 13048f46c45a3595cfe951e6ade31ae030712495 (diff) | |
download | pttbbs-c8185f580f71fb0b8279401fa9b13c7f84895a5a.tar pttbbs-c8185f580f71fb0b8279401fa9b13c7f84895a5a.tar.gz pttbbs-c8185f580f71fb0b8279401fa9b13c7f84895a5a.tar.bz2 pttbbs-c8185f580f71fb0b8279401fa9b13c7f84895a5a.tar.lz pttbbs-c8185f580f71fb0b8279401fa9b13c7f84895a5a.tar.xz pttbbs-c8185f580f71fb0b8279401fa9b13c7f84895a5a.tar.zst pttbbs-c8185f580f71fb0b8279401fa9b13c7f84895a5a.zip |
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@144 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/cal.c | 13 |
1 files changed, 7 insertions, 6 deletions
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 <stdio.h> #include <stdlib.h> #include <string.h> @@ -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; } |