实验四.2

#include <stdio.h> #include <math.h> int main(){ double a,b,c,d; int e; scanf("%lf",&a); e=a/500; switch(e) { case 0:b=0;break; case 1:b=0.05;break; case 2:b=0.08;break; case 3:b=0.08;break; case 4:b=0.1;break; case 5:b=0.1;break; case 6:b=0.1;break; case 7:b=0.1;break; case 8:b=0.1;break; case 9:b=0.1;break; default :b=0.15;break; } c=a*b; d=a-c; printf("a=%lf rate=%lf tax=%lf profit=%lf",a,b,c,d);

return 0; }

原文地址:https://www.cnblogs.com/p201821440010/p/10750449.html