当前位置:网站首页>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>
边栏推荐
- The first screen time, you said you optimized it, then you calculated it and showed it to me!
- Automatic backup of MySQL database in the early morning with Linux
- Junit
- Golang collaboration and channel usage
- Two models of OSPF planning: double tower Raider and dog tooth crisscross
- [issue 22] sheen cloud platform one side & two sides
- A bold sounding and awesome operation - remake a Netflix
- How to design API return codes (error codes)?
- Go language custom DNS resolver practice yyds dry inventory
- Informatics Orsay all in one 1354: bracket matching test
猜你喜欢

Arrangement and insertion structure

buuresevewp

Uniapp wechat withdrawal (packaged as app)

Yyds dry inventory kubernetes easy service discovery and load balancing (11)

Cloud native integration data warehouse heavy release

Redis(4)----浅谈整数集合

The difference between setstoragesync and setstorage

What if the service in Nacos cannot be deleted?
![[UVM basics] understanding of sequence and sequencer](/img/74/ff451e500d0b7154d7bb95398eaef0.jpg)
[UVM basics] understanding of sequence and sequencer

What are the key points of turnover box management in warehouse management
随机推荐
Here is the command to display the disk space usage. Go ahead and pay attention to more wonderful things!
The 9th zero code training camp is officially open for registration! (Beijing, Shanghai, Guangzhou and Shenzhen)
Cloud native integration data warehouse heavy release
[recommend 10 easy idea plug-ins with less tedious and repetitive code]
信息学奥赛一本通 1354:括弧匹配检验
指南针炒股软件开户是合法的吗?安全吗
Chapter 4 (functions and preprocessing)
Apache inlong graduated as a top-level project with a million billion level data stream processing capability!
Yyds dry inventory Druid connection pool usage
Summary of domestic database examination data (continuously updated)
Nine hours, nine people and nine doors (01 backpack deformation) - Niuke
[UVM basics] connect of UVM_ Phase execution sequence
Use middleware to record slow laravel requests
有序排列
[issue 22] sheen cloud platform one side & two sides
Google Earth engine (GEE) 02 basic knowledge and learning resources
Jemter stress test - visualization tool - [usage]
Yyds dry inventory kubernetes easy service discovery and load balancing (11)
Opencv鼠标事件+界面交互之绘制矩形多边形选取感兴趣区域ROI
1010. song backtracking with total duration divisible by 60