哪错了???
#include <iostream>
#include <windows.h>
using namespace std;
const double PI = 3.14159;
const float Stockade_cost = 35; //每米的栅栏价格
const float Passage_cost = 20; //过道价格
class cal
{
public:
cal(float r); //构造函数
float perimeter ; //栅栏长度
float area ; //过道面积
private:
float R; //半径
}
cal::cal(float r)
{
R = r;
}
float cal::perimeter
{return 2 * PI * R; }
float cal::area const
{return PI * R * R;}
int main()
{
float R;
float Stockade_cost;
float Passage_cost;
cout << "输入半径:";
cin >> R;
cal pool(R);
cal maxpool(R + 3);
Stockade_cost = maxpool.perimeter()*Stockade_cost;
cout << "栅栏造价:" << Stockade_cost << endl;
Passage_cost = (maxpool.area() - pool.area())*Passage_cost;
cout << "过道造价:" << Passage_cost << endl;
system("pause");
return 0;
}

#include <windows.h>
using namespace std;
const double PI = 3.14159;
const float Stockade_cost = 35; //每米的栅栏价格
const float Passage_cost = 20; //过道价格
class cal
{
public:
cal(float r); //构造函数
float perimeter ; //栅栏长度
float area ; //过道面积
private:
float R; //半径
}
cal::cal(float r)
{
R = r;
}
float cal::perimeter
{return 2 * PI * R; }
float cal::area const
{return PI * R * R;}
int main()
{
float R;
float Stockade_cost;
float Passage_cost;
cout << "输入半径:";
cin >> R;
cal pool(R);
cal maxpool(R + 3);
Stockade_cost = maxpool.perimeter()*Stockade_cost;
cout << "栅栏造价:" << Stockade_cost << endl;
Passage_cost = (maxpool.area() - pool.area())*Passage_cost;
cout << "过道造价:" << Passage_cost << endl;
system("pause");
return 0;
}

...全文
相关推荐
tryabswap.sln
利用函数来交换数值,正解和错解的经典案例,54545442222112138483123184651231564452123656446651232218465!!够50个字了吗???
MATLAB图像错切_matlab_图像处理_水平错切_图像错切_
**创建错切矩阵**:定义错切因子,然后构建变换矩阵。
求教类似SUMIF;COUNTIF的条件函数的写法???
求教类似SUMIF;COUNTIF的条件函数的写法???
3_层错与孪晶,孪晶与层错能的关系,Unix_Linux
层错能和孪晶形成能是衡量这两种缺陷稳定性的关键参数。层错能是指恢复原始无缺陷晶体结构所需的能量,其值越高,层错越不稳定,越容易移动或消失。
就一定要起这个名字吗???
就一定要起这个名字吗???


