自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 收藏
  • 关注

原创 2-12-2 摩托车继承自行车和机动车

问题及代码:#include #include#include using namespace std;enum vehicleStaus {rest, running}; //车辆状态:泊车、行进class vehicle //车辆类{protected: int maxSpeed; //最大车速 int currentSpeed; //当前速度 i

2015-05-31 20:37:26 437

原创 汇编实验10-3 数值显示

代码及注释:;本程序意图为设计一个子程序实现内存中二进制数转化为10进制数并且显示在屏幕上;程序描述:;将数据12666以十进制的形式显示在屏幕的8行3列,用绿色显示出来。;在显示时调用本实验中第一个字程序show_str;提示:;要将内存中保存的”12666”(内存中以二进制形式保存)转化为显示在屏幕上的字;串”12666”需要经过一定的转换,具体操作就是将12666除以10取余

2015-05-30 08:04:04 1073

原创 汇编实验10-2 解决除法溢出的问题

代码及注释:;本程序主要意图为制作一个子程序,实现32位被除数/16位除数因为16位寄存器不够储存;而产生除法溢出的情况(如FFFFFFFF/1,16位寄存器ax储存不了32位数据);子程序的实现过程在书中实验的提示给了算法,在理解的基础上写出程序即可;以下为程序assume cs:code,ss:stackstack segment db 16 dup (0)stack end

2015-05-29 21:11:26 2707 1

原创 汇编实验-10-1 显示字符串

代码及注释:;本实验意图为设计一个子程序,用来显示以0结尾的一串字符;调用子程序时可以指定字符串在屏幕中的显示位置以及字符串的属性;显示位置:行(0~24)、列(0~79)、字符串属性可在实验9中查到对应值;本程序要求在屏幕的8行3列以绿色显示data段中字符;以下为程序开始assume cs:code,ds:datadata segment db ‘Welcome to mas

2015-05-28 22:51:04 1115

原创 2-12-4 点、圆的关系

问题及代码:#include #include using namespace std;class Point{protected: double x,y;public: Point(int xx=0,int yy=0):x(xx),y(yy) {}; friend istream &operator>>(istream &,Point &); fr

2015-05-27 23:03:56 383

原创 2-12-3 日期时间类

问题及代码:#include using namespace std;class Date{protected: int Year,Month,Day;public: Date():Year(1994),Month(1),Day(1){}; Date(int,int,int); void SetDate(int,int,int);

2015-05-27 08:38:50 392

原创 2-12-1 教师兼干部类

问题及代码:#include #include using namespace std;class Teacher{protected: string Name; int Age; char Sex; string Address; string Tel; string Title;public: Teacher():Name

2015-05-26 12:24:44 432

原创 2-11-4 类族的设计

问题及代码:#include#includeusing namespace std;class Point //定义坐标点类{public: Point():x(0),y(0) {}; Point(double x0, double y0):x(x0), y(y0) {}; void PrintPoint(); //输出点的信息 double GetX

2015-05-24 20:39:31 346

原创 2-11-3 点类派生直线类

问题及代码:#include#includeusing namespace std;class Point //定义坐标点类{public: Point():x(0),y(0) {}; Point(double x0, double y0):x(x0), y(y0) {}; void PrintPoint(); //输出点的信息 double GetX

2015-05-24 12:57:50 378

原创 2-11-2 职员有薪水了

问题及代码:#include #include #include using namespace std;class CPerson{protected: char *m_szName; char *m_szId; int m_nSex;//0:women,1:man int m_nAge;public: CPerson(char *na

2015-05-23 22:44:26 335

原创 2-11-1 储存班长信息的学生类

问题及代码:#include using namespace std;class Stu //声明基类{public: Stu(int n, string nam ):num(n),name(nam){}; //基类构造函数 void display( ); //成员函数,输出基类数据成员private: //(*)访问权限为保护

2015-05-23 17:58:29 328

原创 2-11-0

问题及代码:#include #include using namespace std;class Person{public: Person(char *s) { strcpy(name,s); } void display( ) { cout<<"Name: "<<name<<endl; }priv

2015-05-22 23:46:46 321

原创 2-9-5 方程也是类

问题及代码:#include using namespace std;class CEquation{private: double a; // 未知数系数 double b; // 常数项 char unknown; // 代表未知数的符号 char cha;public: CEquation(double aa=0,do

2015-05-22 21:43:11 456 2

原创 2-9-4 我的向量类

问题及代码:#include using namespace std;class MyVector //定义向量类{public: MyVector(int m); //构造函数,共有m个元素的向量,元素值预置为0 MyVector(const MyVector &v); //复制构造函数 ~MyVector(); //析构函数:释

2015-05-22 21:18:53 398

原创 2-9-3 分数类中的运算符重载(续)

问题及代码:#include #include #include using namespace std;class CFraction{private: int nume; // 分子 int deno; // 分母public: CFraction(int nu=0,int de=1):nume(nu),deno(de) {}; //构造函数,初

2015-05-21 22:28:41 601

原创 2-9-2 Time类中的运算符重载(续)

问题及代码:#include using namespace std;class CTime{private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒 unsigned short int SEC

2015-05-20 21:40:49 319

原创 2-9-1 复数类中的运算符重载(续)

问题及代码:#include using namespace std;class Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r; imag=i;} friend Complex operator+(const Complex &c1,const Compl

2015-05-20 20:58:24 263

原创 2-8-4 String类的构造

问题及代码:#include #include using namespace std;class String{public: String():len(0) { p=new char; }; String(char *s);//需要的成员函数(若需要的话,声明友元函数) String(char *s,int l);

2015-05-20 20:26:10 311

原创 2-8-3 分数类中的运算符重载

问题及代码:#include #include #include using namespace std;class CFraction{private: int nume; // 分子 int deno; // 分母public: CFraction(int nu=0,int de=1):nume(nu),deno(de) {}; //构造函数,初

2015-05-18 17:02:49 374 2

原创 2-8-2 Time类中的运算符重载

问题及代码:#include using namespace std;class CTime{private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒 unsigned short int SEC

2015-05-13 21:29:44 320

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除