高数题目 (暑假)

 

 

Problem Description

  JYC is a fool guy. He is going to give a lesson to the ACM team members.
  This lesson is about calculus. He gives a classics example of calculus to the ACMers.
  The problem is to calculate the volume of the intersected part of the three same cylinders which are vertical to each other. But as a fool guy, he always forgets something, thus when he wants to show his skills of calculus, he forgets how to figure out the problem. Fortunately, Arios is good at maths, so he tells the fool guy "let me show you what is calculus!". Quickly, Arios finishes.
  
  Everyone in this contest must have learned calculus. Can you solve it by using calculus or other mathematic knowledge?

Input

  There are multiple test cases. The first line contains an integer T (T<=100), indicates the test cases.
  Next T line follow. There will be 2 floating numbers r and h (0<2r<=h<=10000) per line. r indicates the the radius of a cylinder, and h indicates the height. Remember that three cylinders are totally same.

Output

  For each test case, output "Case #D: " first, D is the test case number. Then following a floating number (round to 0.001) which is the volume of the intersected part of the three cylinders.

Sample Input

2
5.00 20.00
30.00 110.00

Sample Output

Case #1: 585.786
Case #2: 126529.871

 

积分 高数是个渣

帮锐神友情链接http://ray007great.hostyd.com/2013/07/hdu_04/

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main()
{
	int t;
	int cnt=1;
	cin>>t;
	while(t--)
	{
		double R,H;
		cin>>R>>H;
		printf("Case #%d: %.3lf\n",cnt++,8*(2-sqrt(2))*R*R*R);
	}
	
	return 0;
} 


 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值