📄 c23.cpp
字号:
// c23.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <math.h>
#include <iomanip.h>
int main(int argc, char* argv[])
{
int n,i;
float r1,r2,d,w,h;
float s,volume,surface,pi;
pi=acos(0);
cin>>n;
for(i=1;i<=n;i++)
{
cin>>r1>>r2>>d>>w;
cin>>s;
h=(r1+r2-d)/2;
h=2*r1-h;
// cout<<h<<endl;
volume=2*2*pi*h*h*(r1-h/3);
surface=2*2*2*pi*r1*h;
cout<<setprecision(5)<<volume<<" "<<surface<<endl;
if(volume*s>w)
cout<<"The Paired-Sphere Floats."<<endl;
else
cout<<"The Paired-Sphere Sinks."<<endl;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -