int main()
{
int x,l;
scanf("%d",&x);
switch(x)
{
case(x<=100000):l=x*0.1;break;
case(x>100000&&x<=200000):1=100000*0.1+(x-100000)*0.075;break;
case(x>200000&&x<=400000):l=200000*0.1+(x-200000)*0.05;break;
case(x>400000&&x<=600000):l=400000*0.1+(x-400000)*0.03;break;
case(x>600000&&x<=1000000):l=600000*0.1+(x-600000)*0.015;break;
case(x>1000000):l=1000000*0.1+(x-1000000)*0.01:break;
}
printf("%d",l);
return 0;
}
报错:8 8 D:\oj1.cpp [Error] 'x' cannot appear in a constant-expression