没注释的源代码
#include <iostream>
using namespace std;
class rate
{
public:
void input();
void output();
private:
double r;
double price1,price2;
};
int main()
{
rate t1;
t1.input();
t1.output();
return 0;
}
void rate::input()
{
cout<<"请输入游泳池的半径:";
cin>>r;
}
void rate::output()
{
price1=((2*3.14*r+2*3.14*(r+3))*35);
cout<<"栅栏的价格是:"<<price1<<"元"<<endl;
price2=((3.14*(r+3)*(r+3)-(3.14*r*r))*20);
cout<<"过道的价格是:"<<price2<<"元"<<endl;
}