作者 主题: 暂时存放程序  (阅读 2331 次)

副标题:

离线 ircdm

  • 版主
  • *
  • 帖子数: 658
  • 苹果币: 0
    • http://
暂时存放程序
« 于: 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();
}
what are you going?
i'm going you!