- 博客(57)
- 收藏
- 关注
原创 十七周 任务一
源程序:#include#include using namespace std;class Student{public:Student(void){}Student(char nam[20], double cs, double mas, double ens, double all, double avs):cscore(cs), mathscore(mas),
2012-06-11 18:23:16 2787 1
原创 第十六周实验报告 任务三(改)
源程序:#include #include #include #include using namespace std;class Word{public: Word(); Word(string w, string t, string ci):word(w), translate(t), wordtype(ci){} string get_word(); str
2012-06-06 22:50:24 1588
原创 第十六周实验报告 任务三(最简)
源程序·:#include #include #include #include using namespace std;class Word{public: Word() { word = 'a'; translate = 'a'; cixing = 'a'; } Word(string w, string t, string ci):word(w),
2012-06-05 01:43:34 1253 1
原创 To my teacher...
When i saw the topic what the helao gave to us, my heart was really being shocked!!! I found i was so many words want to express, but i even didn't konw how to start a title.And i also didn't dear to
2012-06-04 01:15:09 1920 1
原创 十六周实验报告 任务二
源程序:#include #include #include #include using namespace std;class Student{public: Student() { name = 'a'; cscore = 0; mathscore = 0; englishscore = 0; sumscore = 0; averagesc
2012-06-03 10:51:53 4407
原创 十六周实验报告 任务一
源程序:#include #include #include using namespace std;int main(){ ifstream infile("salary.txt",ios::in); if(!infile) { cerr << "open error!!!"; exit(0); } double a[500], t; int i, j;
2012-06-02 15:08:01 865 1
原创 第十五周实验报告 任务三
3.1源代码:#include #include using namespace std;int main(){ int a; cout<<"input a:"; cin>>a; cout<<"dec:"<<dec<<a<<endl;//以十进制的形式输出输入的数~ cout<<"hex:"<<hex<<a<<endl;//以十六进制的形式输出输入的数(123456789a
2012-05-28 22:45:09 692
原创 第十五周实验报告 任务一
源程序:triangleDlg.cpp// triangle3Dlg.cpp : 实现文件//#include "stdafx.h"#include "MyTriangle.h"#include "triangle3.h"#include "triangle3Dlg.h"#ifdef _DEBUG#define new DEBUG_NEW#endif// 用于
2012-05-27 13:23:14 622
原创 第十五周实验报告 任务二
源程序:CFractionDlg.cpp// CFractionDlg.cpp : 实现文件//#include "stdafx.h"#include "MyCFraction.h"#include "CFraction.h"#include "CFractionDlg.h"#ifdef _DEBUG#define new DEBUG_NEW#endif//
2012-05-27 13:11:27 1040 1
原创 第十四周实验报告 任务一
源程序:#include using namespace std;class MyArray{private: int *arr; //用于存放动态分配的数组内存首地址 int size; //数组大小public: MyArray(int sz=50) { size = sz; arr = new int[size]; for(int i = 0; i <
2012-05-22 16:19:33 732 1
原创 第十三周实验报告 任务二(3)改
源程序:#include "iostream"#includeusing namespace std;class Animal{public: virtual void cry() = 0;/*{cout<<"不知哪种动物,让我如何学叫?"<<endl;}*/ Animal(string na); virtual ~Animal();protec
2012-05-14 18:30:26 631 1
原创 第十三周实验报告 任务四
源程序:#include#includeusing namespace std;const double P = 3.14;class CSolid//定义虚基类{public: virtual double area() const = 0;//定义纯虚函数 virtual double volume() const = 0;//定义虚函数};cl
2012-05-14 13:30:50 722
翻译 第十三周实验报告 任务三
源程序:#include#includeusing namespace std;const double P = 3.14;class Shape//定义虚基类{public: virtual double area() const = 0;//定义纯虚函数};class Circle:public Shape//定义圆类{public:
2012-05-14 13:25:47 689
原创 第十三周实验报告 任务二(3)
源程序:#include "iostream"#includeusing namespace std;class Animal{public: virtual void cry() = 0;/*{cout<<"不知哪种动物,让我如何学叫?"<<endl;}*/ protected: string name;};class Mouse:public
2012-05-14 13:22:10 612 1
原创 第十三周实验报告 任务二(2)
源程序: #include "iostream"#includeusing namespace std;class Animal{public: virtual void cry() = 0;/*{cout<<"不知哪种动物,让我如何学叫?"<<endl;}*/};class Mouse:public Animal{public: Mouse
2012-05-14 13:06:56 703
原创 第十三周实验报告 任务二(1)
源程序:#include "iostream"#includeusing namespace std;class Animal{public: virtual void cry() {cout<<"不知哪种动物,让我如何学叫?"<<endl;}};class Mouse:public Animal{public: Mouse(string na)
2012-05-14 12:53:37 612
原创 第十三周实验报告 任务一
源程序:#include using namespace std;class Vehicle {public: virtual void run() const = 0; //(3) run()为纯虚函数}; class Car: public Vehicle {public: void run() const {cout << "run a
2012-05-14 12:38:43 642 1
原创 第十周实验报告 任务三(改)
源程序:#include#include//#define P 3.14 宏定义是c语言里的····const double P = 3.14;//c++应该用constusing namespace std;class Point //定义坐标点类{protected: double x, y; //点的横坐标和纵坐标pu
2012-04-23 19:25:44 703
原创 第十周实验报告 任务三
源程序:#include#include#define P 3.14using namespace std;class Point //定义坐标点类{protected: double x, y; //点的横坐标和纵坐标 public: Point(double x0, double y0):x(x0), y(y0){}
2012-04-21 20:54:17 707
原创 第十周实验报告 任务二
源程序:#include #include #include //setw:设置输出数据的宽度,使用时应#include using namespace std;class CPerson {protected: char *m_szName; char *m_szId; int m_nSex;//0:women,1:man
2012-04-21 18:56:49 676 1
原创 第十周实验报告 任务一
源程序:#include#includeusing namespace std;class Point //定义坐标点类{public: double x,y; //点的横坐标和纵坐标 Point(){x=0;y=0;} Point(double x0,double y0) {x=x0; y=y0;} void Pr
2012-04-21 16:37:49 644 1
原创 第九周实验报告 任务五
源程序:#include using namespace std;class CEquation{private: double a; // 未知数系数 double b; // 常数项 char unknown; // 未知数的符号public: CEquation(double aa=0,double bb=0
2012-04-16 20:27:19 396
原创 第九周实验报告 任务三
源程序:#include//using namespace std;class CFraction{private: int nume; // 分子 int deno; // 分母 public: CFraction(int
2012-04-16 20:24:09 381
原创 第九周实验报告 任务二
源程序:#include//using namespace std;class CTime{private: /*unsigned short */int hour; /*unsigned short */int minute; /*unsigned short */int second; public: CTime(in
2012-04-16 20:18:53 355
翻译 第九周实验报告 任务一
源程序:#include//using namespace std;class Complex{public: Complex(){real = 0;imag = 0;} Complex(double r, double i){real = r; imag =i;} friend Complex operator+(Complex &c1,
2012-04-16 20:14:40 449
原创 第八周实验报告 任务四(改)
源程序:#include//using namespace std;class CFraction{private: int nume; // 分子 int deno; // 分母 public: CFraction(int nu=0,int de=
2012-04-09 23:41:22 303
原创 第八周实验报告 任务三(改)
源程序:#includeusing namespace std;class CFraction{private: int nume; // 分子 int deno; // 分母 public: CFraction(int nu=0,int de=1)
2012-04-09 23:36:22 475
原创 第八周实验报告 任务二(改)
源程序:#includeusing namespace std;class CTime{private: /*unsigned short */int hour; /*unsigned short */int minute; /*unsigned short */int second;public: CTime(int h = 0
2012-04-09 19:12:10 356
原创 第八周实验报告 任务四
源程序:#includeusing namespace std;class CFraction{private: int nume; // 分子 int deno; // 分母 public: CFraction(int nu
2012-04-09 19:06:25 371
原创 第八周实验报告 任务三
源程序:#includeusing namespace std;class CFraction{private: int nume; // 分子 int deno; // 分母 public: CFraction(int nu
2012-04-08 18:03:28 470
原创 第八周实验报告 任务二
源程序:#includeusing namespace std;class CTime{private: /*unsigned short */int hour; /*unsigned short */int minute; /*unsigned short */int second; public: CTime(int
2012-04-07 20:59:43 421
原创 第八周实验报告 任务一
源程序:#includeusing namespace std;class Complex{public: Complex(){real = 0;imag = 0;} Complex(double r, double i){real = r; imag =i;} Complex operator+(Complex &c2);/
2012-04-07 20:50:24 733 2
翻译 第七周实验报告 任务三
源程序:#include using namespace std;templateclass Complex {public: Complex( ){real=0;imag=0;} Complex(T r,T i){real=r;imag=i;} Complex complex_add(Complex &c2);
2012-04-03 15:43:20 749 2
原创 第七周实验报告 任务二
源程序:#include#includeusing namespace std;class CPoint { public: CPoint(double xx=0,double yy=0):x(xx),y(yy){} double distance1(CPoint &p);//成员函数的声明 friend double
2012-04-03 15:38:22 481
翻译 第七周实验报告 任务一
源程序:#include#includeusing namespace std;class Time{public: Time(int=0,int=0,int=0); void show_time( ); //根据is_24和from0,输出适合形式-20:23:5/8:23:5 pm/08:23:05 pm void add_se
2012-04-03 15:29:37 477
原创 第六周实验报告 任务五
源程序://main.cpp#include#include "class.h"#includeusing namespace std;void main(){ CPoint p1, p2, p3; CTriangle tri(p1, p2, p3); double b1, b2, b3; while(1) { p1.input();
2012-03-28 22:54:52 361
原创 第六周实验报告 任务四
源程序:#include#includeusing namespace std;class CPoint{private: mutable double x; // 横坐标 mutable double y; // 纵坐标 public: CPoint(double xx=0,double yy=0); dou
2012-03-27 18:53:14 613 2
原创 第六周实验报告 任务三(改进)
源代码:#include#includeusing namespace std;enum SymmetricStyle { axisx,axisy,point};//分别表示按x轴, y轴, 原点对称class CPoint{private: mutable double x; // 横坐标 mutable double y; /
2012-03-27 18:26:57 394
翻译 第六周实验报告 任务三(自己做的···)
源代码:#include#includeusing namespace std;enum SymmetricStyle { axisx,axisy,point};//分别表示按x轴, y轴, 原点对称class CPoint{private: mutable double x; // 横坐标 mutable double y; /
2012-03-27 18:21:46 389
原创 第六周实验报告 任务二
源程序:#includeusing namespace std;class A {private: int a;public: A() {a=0;} A(int aa):a(aa){} //定义构造函数,用参数aa初始化数据成员a};void main() { A *p;//定义类A的指针对象p p = new A(6);
2012-03-27 18:15:04 577 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人