高數題目 (暑假)

來源:互聯網
上載者:User

 

 

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
25.00 20.0030.00 110.00
Sample Output
Case #1: 585.786Case #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;} 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.