Liny_@NotePad

沉迷ACG中

Rotate rotate and rotate

YOYO posted @ 2009年5月12日 18:28 in 【ICPC】解题报告 , 2016 阅读

FJNU2066:http://acm.fjnu.edu.cn/show?problem_id=2066

这是很无语的题目……我不记得PI是多少,于是一开始用3.1415926去,WA
第二次是3.14159265358,还WA。幸好最后B在看到我用附件计算器算其他题目时,记起科学型里面有PI。不然就囧了。

 

  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4.  
  5. #define PI 3.1415926535897932384626433832795
  6.  
  7. int main(){
  8.         int x,y,z;
  9.         while(cin>>x>>y>>z){
  10.                 double r = sqrt((double)(x*x+y*y+z*z));
  11.                 printf("%.3lf\n",4*PI*r*r*r/3.0);
  12.         }
  13.         return 0;
  14. }

不过,牛人用的可是arccos(-1),囧。

  • 无匹配

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter