ACM--圆的摆线公式--湘大oj 1088--Cycloid
来源:互联网 发布:java的发展和前景如何 编辑:程序博客网 时间:2024/06/10 17:54
湘大oj题目地址:传送门
Cycloid
Description
A cycloid is the curve traced by a point on the rim of a circular wheel as the wheel rolls along a straight line. It is an example of a roulette, a curve generated by a curve rolling on another curve.
--from wikipedia
Please calculate the area of an arch of a cycloid generated by a circle of radius r.
You may define pi as acos(-1.0).
Input
The first line of the input consists of a single integer K (1 <= K <= 1,000), denoting the number of test cases. Then K lines follow, each contains a real number r (0.0 < r < 1e3), indicating the radius of circle.
Output
For each test case, output a line containing one real number with exactly three digits after the decimal point, indicating the area of an arch.
Sample Input
2
1.0
3.5
Sample Output
9.425
115.454
============================傲娇的分割线============================
题目意思:求圆走过的那一部分弧线所围成的面积,这个有一个公式,摆线留下的面积等于圆的三倍
#include <stdio.h>#include<iostream>#include<math.h>using namespace std;int main(){ int n; double r; scanf("%d",&n); while(n--){ cin>>r; double x=3*acos(-1.0)*r*r; printf("%.3f\n",x); }}
- ACM--圆的摆线公式--湘大oj 1088--Cycloid
- 圆摆线帮助文件
- 各大ACM OJ网址
- ACM--Five Tiger--湘大oj 1173--五虎棋
- ACM--模拟––湘大OJ 1144--Echo--水
- ACM--模拟--湘大OJ 1142--Collatz Conjecture
- ACM--模拟--湘大OJ 1184--A Love Letter--水
- ACM国内外OJ网站大集合
- ACM国内外OJ网站大集合
- 杭电ACM OJ 1005 Number Sequence 简单却重要的公式题 完美考察了递归思想
- 关于对ACM OJ大数据递归栈溢出问题的解决方案
- 关于对ACM OJ大数据递归 栈溢出 问题的解决方案
- ACM的OJ网站集
- ACM-–模拟打印–-湘大OJ 1086--菱形--水
- OJ上关于阶乘位数的公式
- ACM-大数N!的位数公式
- ACM-大数N!的位数公式
- ACM-大数N!的位数公式
- java 泛型
- android项目中R文件丢失的解决方法
- Runtime 运行时:知识点
- Spark性能优化指南——高级篇
- 把写好的Java类导出jar,在另外的项目引用
- ACM--圆的摆线公式--湘大oj 1088--Cycloid
- JavaScript对象
- python challenge心得
- 音视频编解码技术零基础学习方法
- 解决MyEclipse10启动时Could not create the view: An unexpected exception was thrown.
- mysql的MERGE存储引擎
- ReentrantLock解析,lock与unlock方法分析
- Java学习之构造方法
- 括号配对问题