LightOj-1022-Circle in Square
2017-10-21 10:29
281 查看
题目传送门
题意:给定一个圆的半径,求这个圆的外切正方形的面积与这个圆的面积差。
思路:面积差为
题意:给定一个圆的半径,求这个圆的外切正方形的面积与这个圆的面积差。
思路:面积差为
4*r*r-PI*r*r。
#include <bits/stdc++.h> using namespace std; const double PI = 2*acos(0.0); int main(void) { int T, cas=1; scanf("%d", &T); while (T--) { double r; scanf("%lf", &r); printf("Case %d: %.2f\n", cas++, r*r*(4-PI)); } return 0; }
相关文章推荐
- Circle in Square LightOJ - 1022
- LightOJ 1022 Circle in Square
- LightOJ 1022 Circle in Square(求面积)
- LightOJ Circle in Square (简单计算几何)
- 【Light-oj】-1022 - Circle in Square(水)
- LIGHT OJ-1022 - Circle in Square【浮点精度】
- 通过程序设计几何图形(Shape)、矩形(Rectangle)、圆形(Circle)、正方形(Square)几种类型, 能够利用接口和多态性计算几何图形的面积和周长并显示。
- DB Query Analyzer 5.03 is distributed, EXCEL table name will be enclosed in square bracket
- [Err] 1022 - Can't write; duplicate key in table '#sql-1500_26'
- 设计一个Shape接口和它的两个实现类Square和Circle
- lightoj 1094 - Farthest Nodes in a Tree(树的直径)
- Piont in a circle
- 通过程序设计几何图形(Shape)、矩形(Rectangle)、圆形(Circle)、正方形(Square)几种类型, 能够利用接口和多态性计算几何图形的面积和周长并显示。
- GYM 101086 H.Another Square in the Floor(水~)
- 通过程序设计几何图形(Shape)、矩形(Rectangle)、圆形(Circle)、正方形(Square)几种类型,能够利用接口和多态性计算几何图形的面积和周长并显示。
- UVa 11520 Fill in the Square
- LightOJ-1010-Knights in Chessboard [规律]
- lightoj-1010-Knights in Chessboard
- Determine whether the concatenation of a and b in this order is a square number.
- Cannot find any information on property 'S' in a bean of type 'beans.Circle'