- 博客(13)
- 收藏
- 关注
原创 第十五周作业3.2
#include using namespace std; int main( ) { int a = 54; cout.setf(ios::showbase);//设置输出时的基数符号。 cout << "dec:" << a << endl; //输出结果:dec:54 原因:默认以十进制形式输出a。 cout.unsetf(ios::dec); //终止
2012-05-28 19:04:05 602
原创 第十五周作业3.1
#include #include using namespace std; int main() { int a; cout << "input a:"; cin >> a;//输入20 cout << "dec:" << dec << a << endl; // 输出结果: dec: 20 原因:以十进制形式输出结果20。 cout
2012-05-28 19:02:51 481
原创 第十四周作业2
#include using namespace std; class Student { public: Student(int n,double s){num = n; score = s; next = NULL;} Student *next; int num; double score; }; c
2012-05-28 18:44:30 553
原创 十四周作业1
#include using namespace std; class MyArray { private: int *arr; //用于存放动态分配的数组内存首地址 int size; //数组大小 public: MyArray(int sz=50); MyArray(int a[],int sz); //由一个内置类型的数组初始化 MyArray
2012-05-28 18:40:24 641 1
原创 十五周作业1
// triangle.cpp : 定义应用程序的类行为。 // #include "stdafx.h" #include "triangle.h" #include "triangleDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CtriangleApp BEGIN_MESSAGE_MAP(Ctri
2012-05-28 18:36:27 597
原创 第十五周作业2
// stdafx.cpp : 只包括标准包含文件的源文件 // cfraction.pch 将作为预编译头 // stdafx.obj 将包含预编译类型信息 #include "stdafx.h" #include "stdafx.h"#include "CFrac.h"using namespace std;CFraction CFraction :: operator
2012-05-28 18:27:55 984 1
原创 第十三周作业3
#include using namespace std; class Shape { public: virtual float area() const = 0; }; class Circle:public Shape { public: Circle(float r):radii(r){}; virtual float area() const;
2012-05-14 18:11:27 572 1
原创 第十三周作业2
#include "iostream" #include using namespace std; class Animal { public: virtual void cry() {cout << "不知哪种动物,让我如何学叫?" << endl;} }; class Mouse : public Animal { public: Mouse(string n
2012-05-14 18:09:48 850
原创 第十三周作业1
#include using namespace std; class Vehicle { public: void run() const { cout << "run a vehicle. "<<endl; } //(2) run()为虚函数 }; class Car: public Vehicle { public: void run() con
2012-05-14 18:07:20 619
原创 第十二周作业3
#include #include #include using namespace std; enum vehicleStaus {rest, running}; //车辆状态:泊车、行进 class vehicle //车辆类 { protected: int maxSpeed; //最大车速
2012-05-14 18:02:55 897
原创 第十二周作业4
//自行定义类 //用下面的main()函数测试 #include #include using namespace std; class Point { public: Point(float xx, float yy) { x = xx; y = yy; } void show() { cout << "(" << x <
2012-05-14 17:59:01 389
原创 第十二周作业2
#include #include using namespace std; class Teacher { public: Teacher(string nam, int a, char s, string tit, string ad, string t) : name(nam), age(a), sex(s), title(tit), addr(
2012-05-09 19:36:46 395
原创 第十二周作业1
#include #include using namespace std; class Student //(1)修改student类中各数据成员和成员函数的访问限定符,并观察发生的现象 { public: Student(int n, string nam, char s) ; void show(); ~Studen
2012-05-09 19:28:50 493
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人