公司提成
2015-07-27 11:38
232 查看
#include<stdio.h>
int main()
{
float salary=500;
int grade;
long profit;
while(scanf("%ld",&profit))
{
grade=(profit-1)/1000;
switch (grade)
{
case 0:break;
case 1:salary+=profit*0.1;break;
case 2:
case 3:
case 4:salary+=profit*1.5;break;
case 5:
case 6:
case 7:
case 8:
case 9:salary+=profit*0.2;break;
default:salary+=profit*0.25;
}
printf("%.2f\n",salary);
}
return 0;
}
int main()
{
float salary=500;
int grade;
long profit;
while(scanf("%ld",&profit))
{
grade=(profit-1)/1000;
switch (grade)
{
case 0:break;
case 1:salary+=profit*0.1;break;
case 2:
case 3:
case 4:salary+=profit*1.5;break;
case 5:
case 6:
case 7:
case 8:
case 9:salary+=profit*0.2;break;
default:salary+=profit*0.25;
}
printf("%.2f\n",salary);
}
return 0;
}
相关文章推荐
- 为什么无法定义1px左右高度的容器
- dp之背包总结篇
- 七,可视化的客户端管理工具MongoVUE
- Android 绘图 cache setDrawingCacheEnabled(boolean flag)
- dp之背包总结篇
- 【经验交流】我为什么要帮你?
- Redis学习指南
- 遍历目录下的所有文件
- HDU 4800 Josephina and RPG(动态规划)
- Matlab 符号运算的因式分解、展开与合并、简化
- Ubuntu14.04 搭建FTP
- 开始刷leetcode day78:Lowest Common Ancestor of a Binary Tree
- js 本地预览图片和得到图片实际大小
- 使用Qtip2来开发功能强大的删除和信息提示功能
- 正则表达式——学习入门
- ListView的简单实用
- 括号配对问题
- ACboy needs your help again!(简单栈)
- 判断一个数字中是否包含两个相同的字串
- git命令