标题:新手,希望大家多多指教!敬上一个小程序
只看楼主
山狐
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-9-25
 问题点数:0 回复次数:0 
新手,希望大家多多指教!敬上一个小程序
请指教:
class Crectangle
{
public:
Crectangle(double len=0,double wid=0);
virtual ~Crectangle();
void Set_data(double r,double h){r=len,wid=h;}
double Calctotallength(){totallength=2*(wid+len);}
double Calcarea(){area=wid*len;}
void Getdate()
{return len;
return wid;
}
void Initdate(double k,double j){r=k,h=j;}
vid Output
{
cout<<"length is"<<len<<"wid is"<<wid<<"totallength is"<<totallength<<"area is"<<area<<endl;
}
#include<iostream.h>
#include"rectangle.h"
#include<nath.h>
void main()
{
cout<<"请多多指教啊 "<<endl;
Crectangle myrectangle;
myrectangle.Set_date(2.0,3.0)
myrectangle.calctotalength()
myrectangle.calcarea()
myrectangle.output()
return 0;
}
希望各位“无情的”指出各种不足之处。这厢有礼了
搜索更多相关主题的帖子: 指教 
2008-10-14 22:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-238295-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.279721 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved