我是個對電腦科學有興趣的學生,我會貼上我的學習歷程及生活心情,也請大大們多多指教。 :)

2015年6月11日 星期四

[UVa] 10297 - Beavergnaw

題目網址: https://goo.gl/3O23Y7

題意:
(from luckycat)


解法:
簡單的體積計算。

TAG: Math,

注意:

程式碼:
/**
* Tittle: 10297 - Beavergnaw
* Author: Cheng-Shih, Wong
* Date: 2015/06/11
*/
// include files
#include <bits/stdc++.h>
using namespace std;
// definitions
#define FOR(i,a,b) for( int i=(a),_n=(b); i<=_n; ++i )
#define clr(x,v) memset( x, v, sizeof(x) )
#define PI acos(-1.0)
// declarations
double D, V;
// functions
// main function
int main( void )
{
// input
while( scanf( "%lf%lf", &D, &V )==2 && (D||V) ) {
printf( "%.3lf\n", pow( D*D*D-(6*V)/PI, 1.0/3.0 ) );
}
return 0;
}

沒有留言:

張貼留言

任何意見都樂意傾聽