Cylinder Candy(积分+体积+表面积+旋转体)
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(积分+体积+表面积+旋转体)的更多相关文章
- Cylinder Candy(积分)
Cylinder Candy Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Edward the confectioner is ...
- ZOJ 3866 - Cylinder Candy
3866 - Cylinder Candy Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu ...
- ZOJ - 3866 Cylinder Candy 【数学】
题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3866 思路 积分 参考博客 https://blog.csdn. ...
- 3D模型展示以及体积、表面积计算
本文原创 如转载请注明出处!!! 本博客地址http://www.cnblogs.com/we-jack 本文原创,如果有同样需求的小伙伴请第一时间联系我 或者在留言区留言 上次为大家提供了3D模型的 ...
- zoj 3866
G - Cylinder Candy Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Su ...
- java-7311练习(下)
java练习,仅供参考! 欢迎同学们交流讨论. JDK 1.8 API帮助文档 JDK 1.6 API中文文档 第一次小组作业:模拟双色球彩票 第一次小组作业(一) 控制台版 游戏规则: • 双色球为 ...
- Java【第七篇】面向对象之类设计
Java类的继承 类继承语法规则 < 修饰符> class < 子类名称> [extends < 父类>] { <属性和方法的声明> } 类的继承 子 ...
- Java 类设计----Java类的继承
Java类的继承 为描述和处理个人信息,定义类Person: public class Person { public String name; public inat age; public Dat ...
- c++学习--面向对象一实验
实验内容 一 建立类cylinder,cylinder的构造函数被传递了两个double值,分别表示圆柱体的半径和高度.用类cylinder计算圆柱体的体积,并存储在一个double变量中.在类cyl ...
随机推荐
- Tarjan算法(图论)(转)
有点烦人的算法 贴个算法解析合辑先:https://blog.csdn.net/hurmishine/article/details/75248876
- html-minifier中文文档
HTMLMinifier是一个高度可配置的.经过良好测试的.基于javascript的HTML缩小器.参见相应的博客文章,了解它的工作原理.每个选项的描述.测试结果和结论.在线测试套件.还可以看到相应 ...
- [UWP] 用 AudioGraph 来增强 UWP 的音频处理能力
Audio Graph AudioGraph 是 Windows.Media.Audio 命名空间下提供的音频处理接口之一. 可以通过 AudioGraph 的静态方法 CreateAsync 来实例 ...
- 使用CGlib出现java.lang.NoClassDefFoundError: org/objectweb/asm/Type异常
在学习使用CGlib生成动态代理对象,项目的源代码也很简单: package proxy; import java.lang.reflect.Method; import net.sf.cglib.p ...
- JavaScript使用注意事项
1.jQuery和JS中页面加载完后执行方法的写法 (1)在javascript中用来执行页面加载中的操作时候,我们会使用 window.onload=function(){} window.onlo ...
- Android开发工程师文集-layout_weight讲解
前言 大家好,给大家带来Android开发工程师文集-layout_weight讲解的概述,希望你们喜欢 Layout_weight的相关代码展示 <TextView android:layou ...
- LabVIEW(十二):VI本地化-控件标题内容的修改
一.对于一般LabVIEW的学习,很少遇到本地化的问题但是我们经常会遇到界面控件标题的显示问题.由于各个技术领域的专业性,往往用户对VI界面的显示有自己的要求,其中就包括控件的标题问题,这可以理解成本 ...
- 请求报错:“应以Content-Type: application/x-www-form-urlencoded为请求类型,在form表单中提交登录信息。"
竟然是post 方法少了参数 // // 摘要: // 以异步操作将 POST 请求发送给指定 URI. // // 参数: // requestUri: // 请求发送到的 URI. // // c ...
- CSS 常用技巧
概述 相信大家在写css属性的时候,会遇到一些问题,比如说:垂直对齐,垂直居中,背景渐变动画,表格宽度自适应,模糊文本,样式重置,清除浮动,通用媒体查询,自定义选择文本,强制出现滚动条,固定头部和页脚 ...
- Java异常处理设计(三)
接着上一篇讲. 一个异常日志处理的例子: 抛出异常的地方为: try{ ... ...//省略N行 }catch( Exception e){ throw new RuntimeException ( ...
这是我最初的想法,然后经过求证,体积并不要减去里面的圆柱;
过程已经写得很详尽了。。。
转载请注明出处: