请编写一个程序实现以下的题目要求:1、输入圆柱体的半径(radius)和高(high); 2、定义PI为3.14159; 3、求出圆柱体的体积.Input输入两个数字,第一个数字是圆柱体的半径,第二个是圆柱体的高.Out

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/23 18:52:05

请编写一个程序实现以下的题目要求:1、输入圆柱体的半径(radius)和高(high); 2、定义PI为3.14159; 3、求出圆柱体的体积.Input输入两个数字,第一个数字是圆柱体的半径,第二个是圆柱体的高.Out
请编写一个程序实现以下的题目要求:
1、输入圆柱体的半径(radius)和高(high); 2、定义PI为3.14159; 3、求出圆柱体的体积.
Input
输入两个数字,第一个数字是圆柱体的半径,第二个是圆柱体的高.
Output
输出有三行:第一行是圆柱体的半径,第二行是圆柱体的高,第三行圆柱体的体积.每一个输出的结果保留到小数点后3位.具体的请见Sample Output.
Sample Input
3.8 53 4
Sample Output
radius:3.800
high:5.000
The volume is:226.823
radius:3.000
high:4.000The volume is:113.097

请编写一个程序实现以下的题目要求:1、输入圆柱体的半径(radius)和高(high); 2、定义PI为3.14159; 3、求出圆柱体的体积.Input输入两个数字,第一个数字是圆柱体的半径,第二个是圆柱体的高.Out
#include "stdafx.h"
#include "iostream"
#define PI 3.14159 ;
using namespace std;
double run(double radius,double high)
{double area;
area = high * radius * radius *PI;
return area;
}
int _tmain(int argc,_TCHAR* argv[])
{
double r,h;
cout >h;
cout