當前位置:編程學習大全網 - 電腦編程 - C++編程求助編寫壹個基於對象的程序:輸入半徑,計算圓的周長和面積並輸出

C++編程求助編寫壹個基於對象的程序:輸入半徑,計算圓的周長和面積並輸出

#include<iostream.h>

#define Pi 3.14;

class yuan

{

public:

float length(float);

float area(float);

private:

float r;

};

float yuan::length(float r)

{float len;

len=2*Pi*r;}

float yuan::area(floay r)

{float ar;

ar=Pi*r*r;}

void main()

{

yuan m;

cout<<m.length(10.0)<<m.area(10.0)<<endl;

}

  • 上一篇:雅馬哈dsp3090,dspa1解碼芯片是壹樣嗎
  • 下一篇:石家莊優學思培訓學校怎麽樣
  • copyright 2024編程學習大全網