当前位置:网站首页>Chapter 2-2 calculation of piecewise function [1]
Chapter 2-2 calculation of piecewise function [1]
2022-07-28 08:44:00 【ZJUdebug3790】
This topic requires the calculation of the following piecewise functions f(x) Value :

Input format :
The input gives the real number in one line x.
Output format :
Press in a line “f(x) = result” Format output , among x And result Keep one decimal place
Correct code :
s=float(input())
if s==0:
print("f(0.0) = 0.0")
else:
print("f(%.1f) = %.1f"%(s,1/s))Previous error reporting , Not 0 return ( The last test point can't pass )
s=int(input())
if s==0:
print("f(0.0) = 0.0")
else:
print("f(%.1f) = %.1f"%(s,1/s))Found to be s The type of was defined incorrectly at first
边栏推荐
- 一篇文章搞懂数据仓库:元数据分类、元数据管理
- Matlab (3) matlab program flow control statement
- Win the bid! Nantah general gbase 8s won the bid for the 2022 database framework project of NARI Group
- The current value of uniapp's swiper dynamic setting does not take effect solution
- (十三)基于51单片机的简单温度报警装置
- Introduction to self drive tour of snow mountains in the West in January 2018
- Pyspark writes data to iceberg
- JS inheritance method
- Alibaba internal interview materials
- Uniapp ---- detailed steps to obtain the longitude and latitude of the current position and other information (including applet)
猜你喜欢

Day112.尚医通:手机验证码登录功能

1w5字详细介绍分布式系统的那些技术方案

Customer first | domestic Bi leader, smart software completes round C financing

Smart software completed round C financing, making Bi truly "inclusive"

GB/T 41479-2022信息安全技术 网络数据处理安全要求 导图概览

2022牛客多校第一场解题报告

SQL injection - pre Foundation

SQL注入 ----前置基础

半桥BUCK电路—记录篇

Hcip day 8
随机推荐
【OpenCV】生成透明的PNG图像
Simple use of unity queue
微信小程序----微信小程序浏览pdf文件
ASP. Net core foundation VIII
Vk1620 temperature controller / smart meter LED digital display driver chip 3/4-wire interface with built-in RC oscillator to provide technical support
Flink Window&Time 原理
Smart software completed round C financing, making Bi truly "inclusive"
PHP Basics - PHP uses mysqli
MySQL how to add users and set permissions?
Usage of qgroupbox
2022牛客多校第二场解题报告
Creation of status bar (29)
MySQL怎么查询可以同时判断多个字段值是否存在
JS手写函数之slice函数(彻底弄懂包头不包尾)
Slice function of JS handwriting function (thoroughly understand the header but not the footer)
思迈特软件Smartbi完成C轮融资,推动国产BI加速进入智能化时代
PHPUnit在Window下如何配置
说透缓存一致性与内存屏障
Wechat applet - wechat applet browsing PDF files
Half bridge buck circuit - record