C++问题,编写一个程序计算出球、圆柱和圆锥的表面积和体积
C++问题,编写一个程序计算出球、圆柱和圆锥的表面积和体积
#include
#include
using namespace std;
#define PI 3.1415
class circle
{
public:
\x09void information()
\x09{\x09
\x09\x09double a;
\x09\x09couta;
\x09}
};
class sphere:public circle
{
public:
void first(double s1,double a)
\x09{
\x09\x09double v1;
\x09\x09s1=4*PI*a*a;
//第一二处错误
v1=(PI*a*a*a*4)/3;
cout
#include
#include
using namespace std;
#define PI 3.1415
class circle
{
public:
\x09void information()
\x09{\x09
\x09\x09double a;
\x09\x09couta;
\x09}
};
class sphere:public circle
{
public:
void first(double s1,double a)
\x09{
\x09\x09double v1;
\x09\x09s1=4*PI*a*a;
//第一二处错误
v1=(PI*a*a*a*4)/3;
cout
其他人气:365 ℃时间:2019-12-01 10:36:28
优质解答
你的程序何止那几处错误,简直惨不忍睹.我简单的修改了,编译通过了.#include <iostream>#include <string>using namespace std;#define PI 3.1415class circle{p...
我来回答
类似推荐
猜你喜欢
- 1一批货物要运往某地,货主准备租用汽车运输公司的甲、乙两种货车.已知过去租用这两种货车情况如下表: 第一次 第二次 甲货车的数量 2 5 乙货车的数量 3 6 累计运货吨数 20.5 46(1)问甲
- 2数对(3,2)和(2,3)分别表示什么
- 3这句话英语用法
- 4在X轴上的截距是-5,倾斜角是3/4π的直线的方程为
- 5stay healthy和keep healthy有没有区别
- 6找出下列各组单词中划线部分读音不同的
- 7I wonder why she didn't come to my birthday party.同义句
- 8do you listen to the news (通过) the radio?
- 9this bag is too small.Give me a ( )one,please
- 10电路中一根导线两端的电势相等吗?为什么?