当前位置:网站首页>7-11 calculation of residential water charges by sections
7-11 calculation of residential water charges by sections
2022-07-03 14:09:00 【ᯤ⁹ᴳ⁺ ·】
7-11 Calculate the water charge of residents by sections (10 branch )
To encourage residents to save water , Water companies adopt the method of pricing according to the water consumption , Residents should pay for water y( element ) And monthly water consumption x( Tons of ) relevant : When x No more than 15 Ton time ,y=4x/3; Beyond ,y=2.5x−17.5. Please write a program to calculate the water charge .
Input format :
The input gives a nonnegative real number on one line x.
Output format :
Export the water charge in one line , Accurate to the decimal point 2 position .
sample input 1:
12
sample output 1:
16.00
sample input 2:
16
sample output 2:
22.50
#include<stdio.h>
int main(){
float x;
double y;
scanf("%f",&x);
if(x <= 15){
y=4*x/3.0;
}else{
y=2.5*x-17.5;
}
printf("%.2f",y);
return 0;
}

边栏推荐
- Print. JS -- web page file printing
- UiO-66-COOH装载苯达莫司汀|羟基磷灰石( HA) 包裹MIL-53(Fe)纳米粒子|装载黄芩苷锰基金属有机骨架材料
- Duet date picker (time plug-in that can manually enter the date)
- Toast UI editor (editor allows you to edit your markup document using text or WYSIWYG, with syntax highlighting, scrolling synchronization, real-time preview and chart functions.)
- 金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
- Interface for querying IP home
- The small project (servlet+jsp+mysql+el+jstl) completes a servlet with login function, with the operation of adding, deleting, modifying and querying. Realize login authentication, prevent illegal log
- Common mixins
- QT learning 19 standard dialog box in QT (top)
- jvm-类加载
猜你喜欢

QT learning 25 layout manager (4)
[email"/>Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email

Qt学习24 布局管理器(三)
![[Jilin University] information sharing of postgraduate entrance examination and re examination](/img/1d/550a991385b842a21e2b301725407e.png)
[Jilin University] information sharing of postgraduate entrance examination and re examination

Richview trvstyle liststyle list style (bullet number)

如何使用lxml判断网站公告是否更新

Generate directories from web content

allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取

GoLand 2021.1.1: configure the multi line display of the tab of the open file

QT learning 19 standard dialog box in QT (top)
随机推荐
Common network state detection and analysis tools
How to promote the progress of project collaboration | community essay solicitation
Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
Solve the problem of dormitory router campus network sharing login
GoLand 2021.2 configure go (go1.17.6)
GoLand 2021.1: rename the go project
Uniapp tips - scrolling components
Golang - command line tool Cobra
Invalid Z-index problem
Implementation of Muduo asynchronous logging
Global event bus
【吉林大学】考研初试复试资料分享
MySQL data processing value addition, deletion and modification
selenium 浏览器(1)
Multi person collaborative data annotation based on Baidu brain easydata from scratch
如何使用lxml判断网站公告是否更新
Programmable logic device software testing
小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。
好看、好用、强大的手写笔记软件综合评测:Notability、GoodNotes、MarginNote、随手写、Notes Writers、CollaNote、CollaNote、Prodrafts、Noteshelf、FlowUs、OneNote、苹果备忘录
QT learning 22 layout manager (I)