2.4
#include<stdio.h>
int main()
{
int a;
double rate,tax,profit;
scanf("%d",&a);
if(a<500)
{
printf("a=%d,rate=0,tax=0,profit=%f",a,a);
}
else if((a>=500)&&(a<1000))
{
tax=a*0.05;
profit=a*0.95;
printf("a=%d,rate=0.05,tax=%f,profit=%f",a,tax,profit);
}
else if((a>=1000)&&(a<2000))
{
tax=a*0.08;
profit=a*0.92;
printf("a=%d,rate=0.08,tax=%f,profit=%f",a,tax,profit);
}
else if((a>=2000)&&(a<5000))
{
tax=a*0.10;
profit=a*0.90;
printf("a=%d,rate=0.10,tax=%f,profit=%f",a,tax,profit);
}
else
{
tax=a*0.15;
profit=a*0.85;
printf("a=%d,rate=0.15,tax=%f,profit=%f",a,tax,profit);
}
return 0;
}