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 ...
随机推荐
- PHP字符串函数之 sscanf echo print sprintf vsprintf printf vprintf fprintf vfprintf
sscanf – 根据指定格式解析输入的字符 echo – 输出一个或多个字符串 print – 输出字符串 sprintf – 返回格式化字符串 vsprintf – 返回格式化字符串 (参数为数组 ...
- git cmd 命令在已有的仓库重新添加新的文件夹
正确步骤: 1. git init //初始化仓库 git add .(文件name) //添加文件到本地仓库 git commit -m “first commit” //添加文件描述信息 git ...
- ubuntu16.04安装maven
一.下载maven apache maven官网地址:http://maven.apache.org/download.cgi 找到Link列下的“apache-maven-3.5.2-bin.tar ...
- Unity全面的面试题(包含答案)
一:什么是协同程序? 在主线程运行的同时开启另一段逻辑处理,来协助当前程序的执行,协程很像多线程,但是不是多线程,Unity的协程实在每帧结束之后去检测yield的条件是否满足. 二:Unity3D中 ...
- jdk8新特性(详解)
最近在复习外加看点面试题,jdk8的新特性虽然在项目用用到过一两个,准备系统的了解一下jdk8的常用新特性 一:Lambd表达式 也可称为闭包 引入函数式编程到Java中 为了使现有函 ...
- PHP注释
PHP支持C.C++和 Shell 脚本风格的注释. 单行注释 两个反斜线组成的单行注释 // 注释内容 一个井号组成的单行注释 # 注释内容 说明:PHP单行注释几乎用的都是//,很少使用#来注释内 ...
- [CocoaPods]使用CocoaPods
将Pod添加到Xcode项目中 在你开始之前 检查Specs存储库或cocoapods.org以确保您要使用的库可用. 在您的计算机上安装CocoaPods. 安装 创建Podfile,并添加依赖项: ...
- 使用cygwin中的awk工具进行mysql binlog日志查看[利刃篇]
linux工具确实强悍,然而作为没有linux机器使用权以及开发没有使用linux进行的人,有时想用一些命令确实不方便,所以,才去试着用用cygwin,一款在windows平台上运行的类UNIX模拟环 ...
- OpenStack-Ocata版+CentOS7.6 云平台环境搭建 — 8.仪表盘 Dashboard(horizon)安装配置
仪表盘Dashboard(horizon)是一个web接口,使得云平台管理员以及用户可以管理不同的Openstack资源以及服务.这个部署示例使用的是 Apache Web 服务器. 节点配置信息说明 ...
- Qt之实现网络下发配置的半透明友好提示界面
一.说明 在使用Qt开发的网管客户端程序中,网管客户端主要负责显示设备信息以及对设备下发配置信息等,如配置设备名字.更新设备程序等:由于在网管客户端程序的操作要先经过服务器处理,再由服务器将该命令转发 ...
这是我最初的想法,然后经过求证,体积并不要减去里面的圆柱;
过程已经写得很详尽了。。。
转载请注明出处: