作业:发工资
2015-08-30 09:36
183 查看
#include <stdio.h>
int main()
{
int time=0,money=0;
printf("输入工作小时数:\n");
scanf("%d",&time);
if(time <0)
{
printf("时间不能为负数");
}
else if(time<=40)
{
money=time*20;
}
else
{
money=40*20+(time-40)*30;
}
printf("该员工的周工资为:%d\n",money);
return 0;
}
------------------------------
输入工作小时数:
32
该员工的周工资为:640
输入工作小时数:
48
该员工的周工资为:1040
int main()
{
int time=0,money=0;
printf("输入工作小时数:\n");
scanf("%d",&time);
if(time <0)
{
printf("时间不能为负数");
}
else if(time<=40)
{
money=time*20;
}
else
{
money=40*20+(time-40)*30;
}
printf("该员工的周工资为:%d\n",money);
return 0;
}
------------------------------
输入工作小时数:
32
该员工的周工资为:640
输入工作小时数:
48
该员工的周工资为:1040
相关文章推荐
- Siege的优缺点
- Objective-C isa 指针 与 runtime 机制
- 字符串反转
- 架构设计:负载均衡层设计方案(7)——LVS + Keepalived + Nginx安装及配置
- Codeforces Round #318 (Div. 2) C Bear and Poker (数学)
- Codeforces Round #318 (Div. 2) A Bear and Elections (优先队列模拟,水题)
- Codeforces Round #318 (Div. 2) B Bear and Three Musketeers (暴力)
- 剑指offer之关于整数的处理
- 下载文件 下载文件
- 图片拉伸技巧
- 字符串split
- bootstrap的html编码规范
- 人际关系——我的喜好
- NOIP 2003 加分二叉树
- hash数组的一个简单应用
- 架构设计:负载均衡层设计方案(1)——负载场景和解决方式
- 30多年程序员生涯经验总结【转】
- 8-28
- jQuery.extend 函数详解
- 架构设计:负载均衡层设计方案(8)——负载均衡层总结上篇