Cylinder Candy


Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge

Edward the confectioner is making a new batch of chocolate covered candy. Each candy center is shaped as a cylinder with radius r mm and height h mm.

The candy center needs to be covered with a uniform coat of chocolate. The uniform coat of chocolate is d mm thick.

You are asked to calcualte the volume and the surface of the chocolate covered candy.

Input

There are multiple test cases. The first line of input contains an integer T(1≤ T≤ 1000) indicating the number of test cases. For each test case:

There are three integers r, h, d in one line. (1≤ r, h, d ≤ 100)

Output

For each case, print the volume and surface area of the candy in one line. The relative error should be less than 10-8.

Sample Input

2
1 1 1
1 3 5

Sample Output

32.907950527415 51.155135338077
1141.046818749128 532.235830206285 经过这几天的思考,以及各种抓狂,我只能说数学老师就是牛,一语点了醒我!
好纠结,,,难道以后要背着高数跑。。。 这是我最初的想法,然后经过求证,体积并不要减去里面的圆柱;
过程已经写得很详尽了。。。 转载请注明出处:寻找&星空の孩子
题目链接:http://acm.zju.edu.cn/onlinejudge/contestInfo.do?contestId=361

 #include<stdio.h>
#include<math.h>
#define PI acos(-1.0)
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
double r,h,d;
double v,s;
scanf("%lf%lf%lf",&r,&h,&d);
v=PI*PI*r*d*d+4.0/*PI*d*d*d+*PI*r*r*d+PI*h*((d+r)*(d+r));
s=*(PI*PI*r*d+*PI*d*d+PI*r*r+PI*h*(r+d));
printf("%.12lf %.12lf\n",v,s); }
return ;
}
 

Cylinder Candy(积分+体积+表面积+旋转体)的更多相关文章

  1. Cylinder Candy(积分)

    Cylinder Candy Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Edward the confectioner is ...

  2. ZOJ 3866 - Cylinder Candy

    3866 - Cylinder Candy Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu ...

  3. ZOJ - 3866 Cylinder Candy 【数学】

    题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3866 思路 积分 参考博客 https://blog.csdn. ...

  4. 3D模型展示以及体积、表面积计算

    本文原创 如转载请注明出处!!! 本博客地址http://www.cnblogs.com/we-jack 本文原创,如果有同样需求的小伙伴请第一时间联系我 或者在留言区留言 上次为大家提供了3D模型的 ...

  5. zoj 3866

    G - Cylinder Candy Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Su ...

  6. java-7311练习(下)

    java练习,仅供参考! 欢迎同学们交流讨论. JDK 1.8 API帮助文档 JDK 1.6 API中文文档 第一次小组作业:模拟双色球彩票 第一次小组作业(一) 控制台版 游戏规则: • 双色球为 ...

  7. Java【第七篇】面向对象之类设计

    Java类的继承 类继承语法规则 < 修饰符> class < 子类名称> [extends < 父类>] { <属性和方法的声明> }  类的继承 子 ...

  8. Java 类设计----Java类的继承

    Java类的继承 为描述和处理个人信息,定义类Person: public class Person { public String name; public inat age; public Dat ...

  9. c++学习--面向对象一实验

    实验内容 一 建立类cylinder,cylinder的构造函数被传递了两个double值,分别表示圆柱体的半径和高度.用类cylinder计算圆柱体的体积,并存储在一个double变量中.在类cyl ...

随机推荐

  1. 06-jQuery的文档操作

    之前js中咱们学习了js的DOM操作,也就是所谓的增删改查DOM操作.通过js的DOM的操作,大家也能发现,大量的繁琐代码实现我们想要的效果.那么jQuery的文档操作的API提供了便利的方法供我们操 ...

  2. Android开发之Activity

    活动(Activity) 活动是最容易吸引用户的地方,它是一种可以包含用户界面的组件,主要用于和用户交互. FirstActivity 手动创建活动 新建一个project,不再选择empty act ...

  3. python之os库

    python之os库 os.name 判断现在正在实用的平台,Windows 返回 'nt'; Linux 返回'posix' >>> os.name 'nt' os.getcwd( ...

  4. DDD简明入门之道 - 开篇

    DDD简明入门之道 - 开篇 犹豫了很久才写下此文,一怕自己对DDD的理解和实践方式有偏差,二怕误人子弟被贻笑大方,所以纰漏之处还望各位谅解.不啰嗦,马上进入正题,如果你觉得此文不错就点个赞吧. 概述 ...

  5. 如何减少SQL Server中的PREEMPTIVE_OS_WRITEFILEGATHER等待类型

    在数据库大小分配期间,我正在等待类型PREEMPTIVE_OS_WRITEFILEGATHER.昨天,我将数据库大小配置为供应商建议的值.我们需要将数据库大小设置为700GB,保留150 GB的日志文 ...

  6. Redis 客户端命令总结

    注意:括号里是参数,具体使用的时候不需要括号和逗号,直接使用空格分隔命令以及各个参数即可. 1.对Key操作的命令 exists(key):确认一个key是否存在.存在返回1,不存在返回0. del( ...

  7. 如何完美回答面试官问的Mybatis初始化原理!!!

    前言 对于任何框架而言,在使用前都要进行一系列的初始化,MyBatis也不例外.本章将通过以下几点详细介绍MyBatis的初始化过程. MyBatis的初始化做了什么 MyBatis基于XML配置文件 ...

  8. SQL 的单引号转义字符

    SQL 的转义字符是:'(单引号) 例:select * from user where name = '''06' 其中红色的单引号即表示转义字符,上例中 name的实际条件值为 '06,而不是 ' ...

  9. Restore database use sql `*.bak` file

    1.第一步: 2.第二步: 3.第三布: 4.第四步:

  10. Unicode 字符串排序规则(二):如何比较字符串

    一.UCA 简介 Unicode Collation Algorithm (UCA) 是 Unicode 规定的如何比较两个字符串大小的算法,也是事实上的标准.我们先来看下它的几个特征. 1.1 Mu ...