±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 1179  |  »Ø¸´: 5

cw277

ľ³æ (ÕýʽдÊÖ)

[ÇóÖú] Õâ¸öc++С³ÌÐò±àÒëµÄ´íÎóºÜÆæ¹Ö~~

Ã÷Ã÷Óï·¨ÉÏÓ¦¸ÃûÓдíÎó~~
»Ø¸´´ËÂ¥

» ±¾Ìû¸½¼þ×ÊÔ´Áбí

  • »¶Ó­¼à¶½ºÍ·´À¡£ºÐ¡Ä¾³æ½öÌṩ½»Á÷ƽ̨£¬²»¶Ô¸ÃÄÚÈݸºÔð¡£
    ±¾ÄÚÈÝÓÉÓû§×ÔÖ÷·¢²¼£¬Èç¹ûÆäÄÚÈÝÉæ¼°µ½ÖªÊ¶²úȨÎÊÌ⣬ÆäÔðÈÎÔÚÓÚÓû§±¾ÈË£¬Èç¶Ô°æÈ¨ÓÐÒìÒ飬ÇëÁªÏµÓÊÏ䣺xiaomuchong@tal.com
  • ¸½¼þ 1 : ³ÌÐò.rar
  • 2012-09-26 16:05:12, 86.56 K

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

¸ÐлÉú»îÈÃÎÒÂýÂýѧ»á¿ØÖÆ×Ô¼ºµÄÇéÐ÷£¬Ñ§»á°üÈÝÓëÈÌÄÍ£¬Ñ§»á²»ÔÙÈ¥ÆÚ´ý
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
»ØÌûÖö¥ ( ¹²ÓÐ1¸ö )

cw277

ľ³æ (ÕýʽдÊÖ)

cw277: »ØÌûÖö¥ 2012-09-27 08:46:54
´úÂëÈçÏ£º

//POINT.H
#ifndef _POINT_H
#define _POINT_H

class Point
{public:
  Point(float=0,float=0);
  void setPoint(float,float);
  float getX() const {return x;}
  float getY() const {return y;}
  friend ostream & operator<<(ostream &,const Point &;
protected:
  float x,y;
};
#endif


//CIRCLE.H
#include "point.h"
#ifndef _CIRCLE_H
#define _CIRCLE_H

class Circle:public Point
{public:
  Circle(float x=0,float y=0,float r=0);
  void setRadius(float);
  float getRadius() const;
  float area () const;
  friend ostream &operator<<(ostream &,const Circle &;
protected:
  float radius;
};
#endif

//CYLINDER.H
#include "circle.h"
#ifndef _CYLINDER_H
#define _CYLINDER_H

class Cylinder:public Circle
{public:
  Cylinder (float x=0,float y=0,float r=0,float h=0);
  void setHeight(float);
  float getHeight() const;
  float area() const;
  float volume() const;
  friend ostream& operator<<(ostream&,const Cylinder&;
protected:
  float height;
};
#endif


//POINT.CPP
#include "point.h"
Point:oint(float a,float b)
{x=a;y=b;}

void Point::setPoint(float a,float b)
{x=a;y=b;}

ostream & operator<<(ostream &output,const Point &p)
{output<<"["< return output;
}


//CIRCLE.CPP
//#include
#include "circle.h"
Circle::Circle(float a,float b,float r)oint(a,b),radius(r){}

void Circle::setRadius(float r)
{radius=r;}

float Circle::getRadius() const {return radius;}

float Circle::area() const
{return 3.14159*radius*radius;}

ostream &operator<<(ostream &output,const Circle &c)
{output<<"Center=["< return output;
}


//CYLINDER.CPP
#include "cylinder.h"

Cylinder::Cylinder(float a,float b,float r,float h)
    :Circle(a,b,r),height(h){}

void Cylinder::setHeight(float h){height=h;}

float Cylinder::getHeight() const {return height;}

float Cylinder::area() const
{ return 2*Circle::area()+2*3.14159*radius*height;}

float Cylinder::volume() const
{return Circle::area()*height;}

ostream &operator<<(ostream &output,const Cylinder& cy)
{output<<"Center=["<        <<"\narea="< return output;
}

///main.cpp
#include      //ÈçÓÃVC++Ó¦¸ÄΪ¡Ã#include  
using namespace std;    //ÈçÓÃVC++ӦȡÏû´ËÐÐ
#include "point.h"
#include "circle.h"
#include "cylinder.h"
#include "point.cpp"
#include "circle.cpp"
#include "cylinder.cpp"
int main()
{Cylinder cy1(3.5,6.4,5.2,10);
cout<<"\noriginal cylinder:\nx="<      <      <<", volume="< cy1.setHeight(15);
cy1.setRadius(7.5);
cy1.setPoint(5,5);
cout<<"\nnew cylinder:\n"< Point &pRef=cy1;
cout<<"\npRef as a point:"< Circle &cRef=cy1;
cout<<"\ncRef as a Circle:"< return 0;
}
¸ÐлÉú»îÈÃÎÒÂýÂýѧ»á¿ØÖÆ×Ô¼ºµÄÇéÐ÷£¬Ñ§»á°üÈÝÓëÈÌÄÍ£¬Ñ§»á²»ÔÙÈ¥ÆÚ´ý
4Â¥2012-09-27 08:46:15
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
ÆÕͨ»ØÌû

libralibra

ÖÁ×ðľ³æ (ÖøÃûдÊÖ)

æôÆï½«¾ü

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
cw277: ½ð±Ò+1, ¡ïÓаïÖú, ÎļþÓкü¸¸ö¡£ 2012-09-26 18:22:54
Ö±½Ó°Ñ´úÂëÌùÔÚÌù×ÓÀï°É
matlab/VB/python/c++/Javaд³ÌÐòÇë·¢QQÓʼþ:790404545@qq.com
2Â¥2012-09-26 17:35:36
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

bemoner

½ð³æ (ÕýʽдÊÖ)

°Ñ´úÂëÌù³öÀ´£¬°ïÄ㿴һϣ¡
3Â¥2012-09-26 22:37:22
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

suhhyuan

Ìú³æ (³õÈëÎÄ̳)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï
cw277: ½ð±Ò+19, ¡ï¡ï¡ï¡ï¡ï×î¼Ñ´ð°¸, ллָµã£¬ÄÇÎÒÏÖÔÚÄãQQÁË£¬ ÒÔºóÓÐʲôÎÊÌâ¿ÉÒÔÏòÄãÇë½Ì~ 2012-10-02 18:41:12
ÎÒÕÒµ½ÎÊÌâÁË£º
1¡¢Õâ¸ö¹¤³ÌÀàÐͱ¾Éí¾ÍÊǸöÎÊÌ⣬ËüÏÖÔÚÊÇwindowsÓ¦ÓóÌÐòµÄ£¬Ó¦¸Ã¸ÄΪ¿ØÖÆÌ¨Ó¦ÓóÌÐò£»
2¡¢×¢Ò⣺ÔÚxt12-1.cppÖÐʹÓÃinclude ÖÐÏÔʽÒýÈëÍ·ÎļþºÍ¶ÔÓ¦µÄcppÎļþ,²»ÒªÇáÒ×°ÑcppÎÄ£¨³ý°üº¬main£¨£©º¯ÊýµÄÖ®Í⣩¼þ°üº¬ÔÚÏîÄ¿ÖУ¨Í¨¹ýÓÒ¼üÌí¼Óµ½ÏîÄ¿£¬·ñÔò»á³öÏÖ´óÁ¿¹ÖÒìµÄ´íÎ󣩡£¿ÉÒÔÕâÑù˵£¨²»ÊǾø¶ÔµÄŶ£©£ºÒ»¸öÏîÄ¿ÖÐÖ»°üº¬Ò»¸öcppÎļþÖУ¨ÒýÈëÁËÆäËûcppÎļþ£©ºÍ¶à¸öÍ·Îļþ£¨±àÒëÆ÷»á×Ô¶¯°üº¬½üÀ´£©¡£×ªµ½ÕýÌ⣬¾ÍÊǰѳýxt12-1.cppÖ®ÍâµÄ.cppÎļþ´ÓÏîÄ¿ÖÐÒÆ³ý£¨²»ÊÇɾ³ý£©£»
3¡¢°Ñ£º
#include
using namespace std;
¸ÄΪ£º
#include

ÕâÊÇVC++6.0µÄÎÊÌ⣬ÔÚVSÖв»ÐèÒª´Ë²½£»

½áÊø£¡£¡£¡

ÓÐÎÊÌâÁªÏµÎÒ993007254
5Â¥2012-10-02 11:05:43
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

suhhyuan

Ìú³æ (³õÈëÎÄ̳)

Ŷ£¬³öÁËÒ»¸öbug£¬²»ºÃÒâ˼¡£
°ÉµÚÈý²½ÖеÄ

#include

Ó¦¸ÃΪ

#include
6Â¥2012-10-02 11:11:32
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ cw277 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 302·ÖÇóµ÷¼Á Ò»Ö¾Ô¸°²»Õ´óѧ085601 +8 zyxÉϰ¶£¡ 2026-04-04 8/400 2026-04-05 23:08 by lbsjt
[¿¼ÑÐ] 294Çóµ÷¼Á +4 Grey_Ey 2026-04-01 5/250 2026-04-05 23:05 by Grey_Ey
[¿¼ÑÐ] Çóµ÷¼ÁÇóµ÷¼Á +8 121. 2026-04-02 8/400 2026-04-05 20:15 by lys0704
[¿¼ÑÐ] 275Çóµ÷¼Á +16 waltzh 2026-04-01 16/800 2026-04-05 17:14 by Hdyxbekcb
[¿¼ÑÐ] µ÷¼Á +3 ºÃºÃ¶ÁÊé¡£ 2026-04-02 3/150 2026-04-05 13:02 by arrow8852
[¿¼ÑÐ] 324Çóµ÷¼Á +14 ÏëÉÏѧÇóµ÷ 2026-04-02 15/750 2026-04-04 20:31 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] 315Çóµ÷¼Á +13 СÑòСÑò_ 2026-04-02 14/700 2026-04-04 20:30 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 309Çóµ÷¼Á +4 ¿ìÀÖµÄС°×¸ë 2026-04-04 5/250 2026-04-04 15:55 by cql1109
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +11 ÎâèùÓ±£¡ 2026-04-03 11/550 2026-04-04 09:56 by ССÊ÷2024
[¿¼ÑÐ] 400·ÖÇóµ÷¼Á +3 ÞÏÞÎÇÒÄÓÍ· 2026-04-04 3/150 2026-04-04 08:41 by jp9609
[¿¼ÑÐ] 350Ò»Ö¾Ô¸±±¾©º½¿Õº½Ìì´óѧ08500²ÄÁÏ¿ÆÑ§Ó빤³ÌÇóµ÷¼Á +5 kjnasfss 2026-04-03 5/250 2026-04-03 22:29 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] ÎåÒØ´óѧÍÁľ¹¤³ÌÕе÷¼ÁÉú2026 +3 wyutj 2026-03-31 4/200 2026-04-03 18:21 by zengxj_7201
[¿¼ÑÐ] 11408£¬284·Ö£¬¶þÕ½Õæ³ÏÇóµ÷¼Á +4 12.27 2026-04-02 4/200 2026-04-03 14:14 by dxiaoxin
[¿¼ÑÐ] ÊýÒ»Ó¢Ò»285Çóµ÷¼Á +7 AZMK 2026-04-03 9/450 2026-04-03 13:03 by ms629
[¿¼ÑÐ] 366Çóµ÷¼ÁÒ»Ö¾Ô¸¶«±±´óѧ +8 ÔËÆøÀ´µÃÈôÓÐËÆÎ 2026-04-02 8/400 2026-04-02 21:39 by dongzh2009
[¿¼ÑÐ] 085601Ò»Ö¾Ô¸ÖÐɽ´óѧÉîÛÚ²ÄÁϹ¤³Ì330Çóµ÷¼Á +8 pipiver 2026-03-30 8/400 2026-04-02 12:01 by ms629
[¿¼ÑÐ] 272Çóµ÷¼Á£¬½ÓÊÜ¿çרҵµ÷¼Á£¡ +4 ÏÐÓ㬠2026-03-31 4/200 2026-04-02 11:18 by guyan1000
[¿¼ÑÐ] 310·ÖÇóµ÷¼Á +4 ³É¹¦Éϰ¶wang 2026-04-01 4/200 2026-04-01 20:35 by liu823948201
[¿¼ÑÐ] 288×ÊÔ´Óë»·¾³×¨Ë¶Çóµ÷¼Á£¬²»ÏÞרҵ£¬ÓÐѧÉϾÍÐÐ +25 lllllos 2026-03-30 26/1300 2026-04-01 09:52 by Ò»Ö»ºÃ¹û×Ó?
[¿¼ÑÐ] ±¾¿Æ211×Ü·Ö289£¬08¹¤Ñ§ÕæÐÄÇóµ÷¼Á +3 utopiaE 2026-03-30 3/150 2026-03-30 23:42 by ms629
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û