首页 > 其他 > 详细

“蓝桥杯”练习系统 - 入门训练 - 圆的面积

时间:2020-01-31 21:19:01      阅读:124      评论:0      收藏:0      [点我收藏+]

思路:

求圆的面积: S = PI * r2. 题目已给 PI = atan(1.0) * 4 或 PI=3.14159265358979323.

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cmath>
 4 using namespace std;
 5 
 6 const double PI = atan(1.0)*4;
 7 
 8 int main()
 9 {
10     ios::sync_with_stdio(false);
11     cin.tie(0);
12 
13     int r;
14     cin >> r;
15     printf("%.7f\n", PI * r * r);
16 
17     return 0;
18 }

 

“蓝桥杯”练习系统 - 入门训练 - 圆的面积

原文:https://www.cnblogs.com/AntonLiu/p/12246691.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!