Is This Integration?

2020年1月17日 938点热度 0人点赞 0条评论

Is This Integration?

时间: 1ms        内存:64M

描述:

The image below shows a square ABCD, where AB = BC = CD = DA = a. Four arcs are drawn taking the four vertexes A, B, C, D as centers and a as the radius. The arc that is drawn taking A as center starts at neighboring vertex B and ends at neighboring vertex D. All other arcs are drawn in a similar fashion. Regions of three different shapes are created in this fashion. You must determine the total area of these different shaped regions.

输入:

Each line of the input file contains a floating-point number a indicating the side length of the square, where 0 <= a<= 10, 000.0. Input is terminated by end of file.

输出:

For each test case, output on a single line the area of the different region types in the image above. Each floating point number should be printed with three digits after the decimal point. The first number of each case will denote the area of the striped region, the second number will denote the total area of the dotted regions, and the third number will denote the rest of the area.

示例输入:

0.1
0.2
0.3

示例输出:

0.003 0.005 0.002
0.013 0.020 0.007
0.028 0.046 0.016

提示:

参考答案:

解锁文章

没有看到答案?微信扫描二维码可免费解锁文章

微信扫描二维码解锁

使用微信扫描二维码打开广告页面后可以立即关闭,再刷新此页面即可正常浏览此文章

所跳转广告均由第三方提供,并不代表本站观点!

已经扫描此二维码?点此立即跳转

code

这个人很懒,什么都没留下

文章评论