- 博客(6)
- 收藏
- 关注
原创 第六周实验三
/* (程序头部注释开始) * 程序的版权和版本声明部分 * Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved. * 文件名称: * 作 者: 彭志康 * 完成日期: 2012 年 3
2012-03-28 19:29:44 336
原创 第六周实验二
一,用指针访问对象 class A { private: int a; public: A() {a=5;} A(int aa) : a(aa){}; //定义构造函数,用参数aa初始化数据成员a void display() { cout << a << endl; } }; int
2012-03-28 19:20:41 328
原创 第六周实验一
错误代码 class C { private: int x; public: C(int x){this->x = x;} int getX(){return x;} }; void main() { const C c(5); cout<<c.getX(); system("
2012-03-28 19:11:40 376
原创 第五周实验三
#include using namespace std; class Box { public: Box(); Box(int,int,int); int volume(); int area(); void lwh(); private:
2012-03-21 20:01:34 674
原创 第五周实验一
#include #include using namespace std; class Triangle {public: Triangle(float x=1,float y=1,float z=1);//声明构造函数时指定默认参数 float perimeter(void);//计算三角形的周长
2012-03-21 19:58:47 475
原创 第四周实验二
#include #include"Time.h" using namespace std; int main( ) { Time t1; Time &t2=t1; t1.set_time( ); t1.show_time( );
2012-03-14 18:17:30 273
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人