#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
const double PI = acos(-1);
int xa, ya, za, xb, yb, zb;
int main()
{
while(scanf("%d %d %d %d %d %d", &xa, &ya, &za, &xb, &yb, &zb) != EOF)
{
double R = sqrt( pow(1.0*abs(xa-xb), 2) + pow(1.0*abs(ya-yb), 2) + pow(1.0*abs(za-zb), 2) );
printf("%.3f %.3f\n", R, PI*pow(R, 3)*4/3.0);
}
return 0;
}
【清华大学考研机试题】球的半径和体积
最新推荐文章于 2020-07-19 09:19:55 发布
