当前位置:网站首页>OJ daily practice - Bonus
OJ daily practice - Bonus
2022-04-21 16:09:00 【Kj JK】
Problem description :
The bonus paid by the enterprise is based on the profit (I) Royalty .
The profit is no higher than 100000 yuan , Bonus can be raised 10% The profits of the ;
Profit exceeds 100000 element , But not higher than 200000 Yuan time ,100000 The part of RMB yuan and below shall be according to 10% Royalty , exceed 100000 Part of the yuan , It's a percentage 7.5%;
Profit exceeds 200000 element , But not higher than 400000 Yuan time ,200000 The part of RMB yuan and below shall be according to 10% Royalty , exceed 200000 Part of yuan by 5% Royalty ;
Profit exceeds 400000 element , But not higher than 600000 Yuan time ,400000 The part of RMB yuan and below shall be according to 10% Royalty , exceed 400000 Part of yuan by 3% Royalty ;
Profit exceeds 600000 element , But not higher than 1000000 Yuan time ,600000 The part of RMB yuan and below shall be according to 10% Royalty , exceed 600000 Part of yuan by 1.5% Royalty ;
Profit exceeds 1000000 element ,1000000 The part of RMB yuan and below shall be according to 10% Royalty , exceed 1000000 Part of yuan by 1% Royalty .
Input
A positive integer , Represents the profit of the current month .
Output
A floating point number , Indicates the bonus of the current month , Accurate to the decimal point 1 position .
Examples
Input
900
Output
90.0
Java Code :
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner rd= new Scanner(System.in);
double j=0;
int a=rd.nextInt();
if(a<100000) {
j=a*0.1;
System.out.println(j);
}else if(a>100000&&a<=200000) {
j=100000*0.1+(a-100000)*0.075;
System.out.println(j);
}else if(a>200000&&a<=400000) {
j=200000*0.1+(a-200000)*0.05;
System.out.println(j);
}else if(a>400000&&a<=600000) {
j=400000*0.1+(a-400000)*0.03;
System.out.println(j);
}else if(a>600000&&a<=1000000) {
j=600000*0.1+(a-600000)*0.015;
System.out.println(j);
}else {
j=1000000*0.1+(a-1000000)*0.01;
System.out.println(j);
}
}
}
C Code :
#include <stdio.h>
int main(){
double j=0;
int a;
scanf("%d",&a);
if(a<100000) {
j=a*0.1;
printf("%.1f",j);
}else if(a>100000&&a<=200000) {
j=100000*0.1+(a-100000)*0.075;
printf("%.1f",j);
}else if(a>200000&&a<=400000) {
j=200000*0.1+(a-200000)*0.05;
printf("%.1f",j);
}else if(a>400000&&a<=600000) {
j=400000*0.1+(a-400000)*0.03;
printf("%.1f",j);
}else if(a>600000&&a<=1000000) {
j=600000*0.1+(a-600000)*0.015;
printf("%.1f",j);
}else {
j=1000000*0.1+(a-1000000)*0.01;
printf("%.1f",j);
}
}
author :KJ.JK
This article is only for communication learning , Without the permission of the author , Prohibited reproduced , Let alone for other purposes , Offenders will investigate .
If the article is helpful to you , Welcome to praise or star, Your support is the greatest encouragement to the author , The shortcomings can be corrected in the comments section , Communication and learning
版权声明
本文为[Kj JK]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211608484737.html
边栏推荐
- PowerShell blog directory
- Universal navigation: a concise and practical comprehensive navigation website
- How does infotnews memes, myths and NFT build cultural identity?
- 嵌入式GUI盘点-你了解几款?
- 外包学生管理系统架构方案
- Infrastructure 知识: DNS 命令: dig, host
- Lightly:新一代的 PHP IDE
- 回调函数
- R语言广义线性模型函数GLM、glm函数构建逻辑回归模型(Logistic regression)、使用卡方检验验证两个逻辑回归模型是否具有显著性(即删除无用特征后的模型和原始模型是否具有明显差异)
- 【2023校招刷題】華為性格測評(綜合測評)戰略指南
猜你喜欢

Servlet

柱状图应用全面剖析
Programmer meituan interview experience, from basic to algorithm, lasted six hours, with an annual salary of 20W

dom操作元素 总结

函数栈帧的创建和销毁(了解)

Callback function

How can I easily manage harbor in multi-user scenarios!

Outsourcing student management system architecture scheme

CLion 中添加 release 配置

Mark一下,两年365个粉丝
随机推荐
R语言广义线性模型函数GLM、广义线性模型(Generalized linear models)、glm函数构建逻辑回归模型(Logistic regression)
Sharkteam releases quarterly report on security situational awareness of Q1 smart contract in 2022
Avril 2022 classement de la base de données de la Chine: la brise printanière se réchauffe et les scores rebondissent en avril
PowerShell blog directory
首届船海数据智能应用创新大赛赛事公告
R语言aov函数进行单因素方差分析(One-way ANOVA)、使用Q-Q图来评估方差分析因变量的正态性、Bartlett验证方差的相等性(齐次性)、car包中的outlierTest函数异常检验
嵌入式GUI盘点-你了解几款?
CLion 中添加 release 配置
SharkTeam发布2022年Q1智能合约安全态势感知季报
Ji Geng 56 / 90
Data processing input box section
【2023校招刷題】華為性格測評(綜合測評)戰略指南
Outsourcing student management system architecture scheme
一文读懂PlatoFarm新经济模型以及生态进展
外包学生管理系统架构方案
Meizu official machine brushing tutorial address (free)
Spark综合练习——电影评分数据分析
求字符串最长子串
HMC foundation big Ma robot synchronization token HMC (seaman) will launch pancakeswap
mingw下载