当前位置:网站首页>C语言:简单的利润与奖金
C语言:简单的利润与奖金
2022-04-21 20:10:00 【艽野尘梦520】
标题C语言:简单的利润与奖金
问题:企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高 于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可以提成7.5%;20万到40万之间时,高于20万元的部分,可提成5%;40万到60万之间时高于40万元的部分,可提成3%;60万到100万之间时,高于60万元的部分,可提成1.5%,高于100万元时,超过100万元的部分按1%提成,从键盘输入当月利润I,求应发放奖金总数?
#include<stdio.h>
void main()
{
long int i;
float bonus1,bonus2,bonus4,bonus6,bonus10,bonus=0;
printf("请输入利润");
scanf("%ld",&i);
bonus1=100000*0.1;
bonus2=bonus1+100000*0.075; //二十万元奖金
bonus4=bonus2+200000*0.05; //四十万元奖金
bonus6=bonus4+200000*0.03;//六十万元奖金
bonus10=bonus6+400000*0.015; //一百万元奖金
if(i<=100000)
bonus=i*0.1;
else if(i<=200000)
bonus=bonus1+(i-100000)*0.075; //十万元的奖金+超出部分奖金
else if(i<=400000)
bonus=bonus2+(i-200000)*0.05; //二十万元的总奖金+超出部分奖金
else if(i<=600000)
bonus=bonus4+(i-400000)*0.03;//四十万元的总奖金+超出部分奖金
else if(i<=1000000)
bonus=bonus6+(i-600000)*0.015; //六十万元的总奖金+超出部分奖金
else
bonus=bonus10+(i-1000000)*0.01; //一百万元的总奖金+超出部分奖金
printf("应发放奖金%f元\n",bonus);
}

版权声明
本文为[艽野尘梦520]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_46066007/article/details/103685518
边栏推荐
- The difference between PE P / E ratios
- Share the advantages of Intranet instant messaging software
- Test while (U --); And while (U) U --; Differences between
- Solution when the port is occupied
- URL to download network resources
- TCP example of grpc implemented by golang
- 【暑期实习】字节客户端一面
- La différence et la relation entre glew, Glee et GL Glu glut glx glext
- Jerry's unshielded interrupt [chapter]
- How to restore the deleted photos? Four schemes, which is the official guide
猜你喜欢

What exactly is a vector?

Source insight configuration and problem summary

Jmeter如何设置参数化

Code out efficiency Chapter 7 concurrency and multithreading

TCP example of grpc implemented by golang

80. (leaflet chapter) leaflet calls the PostGIS data layer published by GeoServer

Three implementation methods of quick sorting

vmware-vmx.exe无法结束进程

LeetCode_746 使用最小花费爬楼梯
Mandelbrot集的最新变化形态一览——MandelBox,Mandelbulb,Burning Ship,NebulaBrot
随机推荐
Use of auto keyword
第九届”大唐杯“全国大学生移动通信5G技术大赛省赛获奖名单公示
全国各大城市的经纬度表,留着以后做查询库用
R language data analysis from entry to advanced: (8) data format conversion of data cleaning skills (including the conversion between wide data and long data)
CUDA02 - 访存优化和Unified Memory
Configuration of tornow and tornow environment
What is annotation
如何判斷Int型值的第nbit比特是否是1還是0
IaaS,PaaS,SaaS 的区别
php UEditor上传文件(图片视频)到OSS
How chaotic is the research market
人机验证reCAPTCHA v3使用完备说明
Use of register keyword
Comment déterminer si le BIT nbit de la valeur de type int est 1 ou 0
Code out efficiency Chapter 7 concurrency and multithreading
Employment of college students in the "most difficult employment season": more than half of the graduates have landed, and higher vocational colleges produce sweet pastries
Unity Socket
渤海期货开户安全吗?渤海期货公司开户方法是什么?
[verbs] precautions for using ibverbs API | what is the status of fork() support in libibverbs?
[original] BigInteger. Large number multiplication. Large number operation. "Infinite number" multiplication. Comparison of two methods of large number multiplication