早教吧 育儿知识 作业答案 考试题库 百科 知识分享

请编写一个程序实现以下的题目要求: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
▼优质解答
答案和解析
#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
看了 请编写一个程序实现以下的题目...的网友还看了以下: