#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
printf("请输入您的销售额:\n");
int xiaoShouE = 0;
scanf("%d", &xiaoShouE);
int k = 0;
float gongZi = 500.0f;
if(xiaoShouE % 10 == 0)
{
k = xiaoShouE / 1000;
}else
{
k = xiaoShouE /1000 + 1;
}
switch(k)
{
case 0 :
case 1 :
case 2 :
printf("没有提成!\n");
break;
case 3 :
case 4 :
case 5 :
gongZi = gongZi + xiaoShouE * 0.08;
printf("工资为%f",gongZi);
break;
case 6 :
case 7 :
case 8 :
case 9 :
case 10 :
gongZi = gongZi + xiaoShouE * 0.1;
printf("工资为%f",gongZi);
break;
default :
gongZi = gongZi + xiaoShouE * 0.12;
printf("工资为%f",gongZi);
}
return 0;
}
|