当前位置:网站首页>Area of Blue Bridge Cup 2 circle
Area of Blue Bridge Cup 2 circle
2022-06-26 07:50:00 【Don't hit me, it hurts!】
explain : In the subject , Input is an integer , But the output is a real number .
On the problem of real number output , Please be sure to see the requirements of real output , For example, it is required to keep the decimal point after this question 7 position , Your program must Strict Output 7 Decimal place , It's not good to output too many or too few decimal places , Would be considered wrong .
If there is no special explanation for the problem of real number output , Rounding is done by rounding .
Code :
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int r;
double s;
cin>>r;
double PI=3.14159265358979323;
s=PI*r*r;
printf("%.7lf\n",s);
return 0;
}
The title is not difficult. , But there are some knowledge points .
Keep the decimal places :
c++ The method provided in is troublesome , With the help of c Methods in language ,
printf("%.2f\n", a);// Retain 2 Decimal place ,%.?f ? The number at indicates the number of decimal places reserved
The header file :#include <stdio.h>
边栏推荐
- Multisensor fusion sensing
- The long path of Xiao Sha (graph theory, Euler diagram)
- Chapter 5 (array)
- Jmeter压力测试-Web代理本地接口测试【教学篇】
- Livevideostackcon | evolution of streaming media distribution for online education business
- Opencv mouse event + interface interaction drawing rectangle polygon selection ROI
- Use middleware to record slow laravel requests
- buuresevewp
- 45. jumping game II dynamic planning DP
- Encapsulating ranging and surface class based on leaflet
猜你喜欢

Nine hours, nine people and nine doors (01 backpack deformation) - Niuke

Record the dependent installation problems encountered in building the web assets when developing pgadmin

Gavin teacher's insight on transformer live class - multi state transition of financial BOT and rasa interactive behavior analysis of Rasa project (52)
![[NLP] vector retrieval model landing: Bottleneck and solution!](/img/c4/784534e5504dfee1c989d19255c31b.jpg)
[NLP] vector retrieval model landing: Bottleneck and solution!

PCB miscellaneous mail

Solve psycopg2 NotSupportedError: PQconninfo not available in libpq < 9.3

Jemter 压力测试 -基础请求-【教学篇】

Attention mechanism yyds, AI editor finally bid farewell to P and destroyed the whole picture

Oracle creates stored procedures with return values and executes SQL calls

Power apps application practice | easily develop employee leave attendance management applet with power apps
随机推荐
The "big grievances" in the workplace are not only physically tired, but also mentally emptied
Getdrawingcache of view is empty. Solution: interview questions for Android audio and video development
Record the dependent installation problems encountered in building the web assets when developing pgadmin
Chapter 5 (array)
A bold sounding and awesome operation - remake a Netflix
[recommend 10 easy idea plug-ins with less tedious and repetitive code]
buuresevewp
I3wm get window class
Chapter 3 (data types and expressions)
The 9th zero code training camp is officially open for registration! (Beijing, Shanghai, Guangzhou and Shenzhen)
buuresevewp
2022 ranking of bank financial products
Redis (4) -- Talking about integer set
PyTorch-12 GAN、WGAN
Gavin teacher's insight on transformer live class - multi state transition of financial BOT and rasa interactive behavior analysis of Rasa project (52)
Jemter 压力测试 -可视化工具支持-【安装篇】
Go language custom DNS resolver practice yyds dry inventory
Median segmentation (find rules) - Niuke
Livevideostackcon | evolution of streaming media distribution for online education business
信息学奥赛一本通 1354:括弧匹配检验