初生襁褓狮
|
发表于:
2007-04-26 13:40
|
显示全部
短消息
资料
【求助】C++(意想不到的文件结束发现了)
哥們幫我 !!!!!#include<iostream.h> #include<string.h> #define PI 3.14159 class Circle { private: double radius; double aear; public: void Get_R_Aear(double r,double a) { radius=r; aear=a; a=PI*r*r; } void Show_Aear(double r,double a) { cout<<"輸入r:"; cin>>r; cout<<"面積為:"<<a<<endl; } }; class Table { private: int height; public: int Get_Height(int h) { return height=h; }; void Show_Height() { cout<<"高為:"<<height<<endl; }; }; class Roundtable:public Circle,public Table { private: char Color[5]; public: Get_Color(char c[]) { strcpy(Color,c); }; void Show_Color() { cout<<"顔色為:"<<Color<<endl; }; }; void main() { Roundtable Rt; Rt.Get_R_Aear(); Rt.Show_Aear(); Rt.Get_Height(100); Rt.Show_Height(); Rt.Get_Color("red"); Rt.Show_Color(); }
2007-05-01 11:50:24
|