代码文本:
#include "stdio.h"
int main(int argc,char *argv[]){
double x,tax
printf("Please enter the number salary, negative end...\n")
while(scanf("%lf",&x),x>=0){
if(x>=5000)
tax=(x-5000)*0.2+4200*.03
else if(x>=800 &&x<5000)
tax=(x-800)*.03
else
tax=0
printf("You should pay %.2f yuan.\n",tax)
}
return 0
}