純美蘋果園
站务管理 => 跑團歷史區 => 歷史區 => 罪恶深渊 => 主题作者是: ircdm 于 2007-09-19, 周三 19:22:00
-
#include "iostream.h"
const float pi=3.141592;
class round
{
public:
round(float r)
{
s=pi*r*r;
wholelong=2*pi*r;
}
float get_s()
{
return s;
}
float get_wholelong()
{
return wholelong;
}
private:
float s,wholelong;
}
main()
{
round round1(2.0);
cout<<round1.get_s()<<"\n";
cout<<round1.get_wholelong();
}