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 ... 
随机推荐
- spring boot2 集成Redis
			1. 引入依赖 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spr ... 
- jmeter+Jenkins持续集成(邮件通知)
			jmeter构建后,自送发送邮件到指定的邮箱,配置如下 1)Jenkins Location配置 jenkins首页->系统管理->系统配置页面 其中Jenkins URL有默认值,最好修 ... 
- python 在unix下json格式显示结果
			在使用命令号输出接口测试结果,发现无法按照期望的json格式进行显示.查阅资料发现python自带强大的工具. 直接上代码: import os,requests url = XXXXXX conte ... 
- IMAGE WATCH工具安装与学习
			1.下载安装 从下载地址搜索IMAGE WATCH,即可下载自己所需要的IMAGE WATCH工具. 安装ImageWatch,双击ImageWatch.vsix进行安装即可: 2.使用示例 这里首先 ... 
- scala字符串前加s使用$
			https://my.oschina.net/u/2000675/blog/1592140 字符串中的变量替换,Scala中基础的字符串插值就是在字符串前加字幕‘s’,然后在字符串中放入变量,每个变量 ... 
- ubuntu下chrome浏览器安装flash插件(pepperflashplugin-nonfree)
			安装前说明: ubuntu的Google 已经不能使用Adobe Flash了,需要用PepperFlashPlayer来替代 Adobe Flash才行. 安装步骤: 1.安装pepperflash ... 
- Android开发工程师文集-Fragment,适配器,轮播图,ScrollView,Gallery 图片浏览器,Android常用布局样式
			Android开发工程师文集-Fragment,适配器,轮播图,ScrollView,Gallery 图片浏览器,Android常用布局样式 Fragment FragmentManager frag ... 
- nginx反向代理转发apache配置 之 cookie去哪儿了?
			在公司接手了个微信项目,由于微信环境下访问网站需要使用对外开放的域名,所以有相关问题,都是直接运维同事帮忙处理. 原理是这样: 方案一: 1. 将域名解析指向测试服务器的地址: 2. 开放相关端口访问 ... 
- C语言中const关键字的用法
			关键字const用来定义常量,如果一个变量被const修饰,那么它的值就不能再被改变,我想一定有人有这样的疑问,C语言中不是有#define吗,干嘛还要用const呢,我想事物的存在一定有它自己的道理 ... 
- Python多进程库multiprocessing中进程池Pool类的使用
			问题起因 最近要将一个文本分割成好几个topic,每个topic设计一个regressor,各regressor是相互独立的,最后汇总所有topic的regressor得到总得预测结果.没错!类似ba ... 
