自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(50)
  • 资源 (6)
  • 收藏
  • 关注

原创 添加一个三角类

//扩展程序:创建一个三角形类 //修改create_object函数,使得程序支持三角形的创建 //和求面积、打印等操作 #include #include using namespace std; class Shape { public: virtual double getArea() const =0; v

2015-05-25 21:30:26 556

原创 在程序中使用继承和组合 第五章第十题

#include #include using namespace std; class Teacher //教师类 {public: Teacher(int,char [],char); //声明构造函数 void display();

2015-05-17 23:27:15 630

原创 分别定义教师类和干部类 采用多重继承方式 第五章第九题

#include #include using namespace std; class Teacher {public: Teacher(string nam,int a,char s,string tit,string ad,string t); void display(); protected: string name; int ag

2015-05-17 23:25:28 1340

原创 改为公用继承方式 第五章第四题

#include using namespace std; class Student //声明基类 {public: //基类公用成员 void get_value(); void display( ); protected :

2015-05-17 23:22:51 1015

原创 保护继承方式 第五章第三题

#include using namespace std; class Student //声明基类 {public: //基类公用成员 void get_value(); void display( ); protected :

2015-05-17 23:21:36 523

原创 用私有继承方式 第五章第二题

#include using namespace std; class Student {public: void get_value() {cin>>num>>name>>sex;} void display( ) {cout<<"num: "<<num<<endl; cout<<"name: "<<name<<endl; cout<

2015-05-17 23:19:36 455

原创 用公用继承方式 第五章第一题

#include using namespace std; class Student {public: void get_value() {cin>>num>>name>>sex;} void display( ) {cout<<"num: "<<num<<endl; cout<<"name: "<<name<<endl; cout<

2015-05-17 23:10:46 461

原创 第六题

#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r){real=r;imag=0;} Complex(double r,double i){real=r;imag=i;} operator double(){retur

2015-05-11 23:40:07 659

原创 定义一个教师类和一个学生类 第七题

#include using namespace std; class Student {public: Student(int,char[],char,float); int get_num(){return num;} char * get_name(){return name;} char get_sex(){return sex;} void disp

2015-05-11 23:39:26 2962

原创 重载流插入运算符《和流提取运算符》 第五题

#include //using namespace std; class Matrix {public: Matrix(); friend Matrix operator+(Matrix &,Matrix &); friend ostream& operator<<(ostream&,Matrix&); friend istream& operator>

2015-05-11 23:38:21 1768

原创 有两个矩阵a和b 均为2行3列 求两个矩阵之和第四题

#include using namespace std; class Matrix //定义 Matrix 类 {public: Matrix(); //默认构造函数 friend Matrix oper

2015-05-11 23:37:13 18771 1

原创 定义一个复数类Coplex 使之能用于复数的加法运算 第三题

#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex ope

2015-05-11 23:35:33 1657

原创 定义一个复数类Complex 第一题

#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} double get_real(); double get_imag(); void display();

2015-05-11 23:32:56 15850 2

原创 定义一个复数类Complex 重载运算符 第二题

#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex operator-(Complex

2015-05-11 23:32:27 8353 1

原创 用重载时间相加

#include #include using namespace std; class Time { public: void display(){cout<<hour<<":"<<minute<<":"<<sec<<endl;} protected: int hour; int minute; int sec; };

2015-05-11 22:58:08 402

原创 与类有关的知识点

2015-04-20 16:43:06 279

原创 将例3.14改写为在类模版外定义各成员函数(第三章第十二题)

#include using namespace std;templateclass Compare{public:Compare(numtype a,numtype b);numtype max();numtype min();private:numtype x,y;};template Compare::Compare(numtype a,numtype b){x=a

2015-04-20 15:57:31 4578

原创 将例3.13中的Time类声明为Date类的友元类(第三章第十一题)

#include using namespace std;class Time;class Date{public:Date(int,int,int);friend Time;private:int month;int day;int year;};Date::Date(int m,int d,int y):month(m),day(d),year(y){ }class

2015-04-20 15:56:23 5511

原创 将例3.13中程序中的display函数不放在Time类中(第三章第10题)

#include using namespace std;class Date;class Time{public:Time(int,int,int);friend void display(const Date &,const Time &);private:int hour;int minute;int sec;};Time::Time(int h,int m,int

2015-04-20 15:50:26 8117

原创 商店销售某一商品,商店每天公布统一的折扣(第三章第9题)

#include using namespace std;class Product{public:Product(int n,int q,float p):num(n),quantity(q),price(p){};void total();static float average();static void display();private:int num

2015-04-20 15:45:46 14589 2

原创 增加一个fun函数,使用对象的引用作为形参(第三章第八题)

#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}void change(int n,float s) {num=n;score=s;}void display() {cout<<num<<" "<<score<<endl;}private:int nu

2015-04-20 15:38:29 1841

原创 第三章第七题(5)

#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}void change(int n,float s) {num=n;score=s;}void display() {cout<<num<<" "<<score<<endl;}private:int nu

2015-04-20 15:34:45 378

原创 第三章第七题(4)

#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}void change(int n,float s) {num=n;score=s;}void display() const{cout<<num<<" "<<score<<endl;}private:i

2015-04-20 15:30:33 399

原创 第三章第七题(3)

#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}void change(int n,float s) {num=n;score=s;}void display() {cout<<num<<" "<<score<<endl;}private:int nu

2015-04-20 15:24:32 405

原创 第三章第七题(2)

#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}void change(int n,float s) const {num=n;score=s;}void display() const {cout<<num<<" "<<score<<endl;}pri

2015-04-20 15:21:44 467

原创 输出成绩(第三章第六题0

#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}void change(int n,float s) {num=n;score=s;}void display(){cout<<num<<" "<<score<<endl;}private:int num

2015-04-20 14:42:56 395

原创 建立一个对象数组,设立一个函数max,选出成绩最高的(第三章第五题)

#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}int num;float score;};void main(){Student stud[5]={Student(101,78.5),Student(102,85.5),Student(103,9

2015-04-20 14:30:55 929

原创 建立一个数组,从五个数据选出三个(第三章第四题)

#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}void display();private:int num;float score;};void Student::display(){cout<<num<<" "<<score<<endl;}

2015-04-20 14:27:13 628

原创 将输出的年月日修改为默认参数(第三章第三题)

#include using namespace std;class Date{public:Date(int=1,int=1,int=2005);void display();private:int month;int day;int year;};Date::Date(int m,int d,int y):month(m),day(d),year(y){ }void

2015-04-20 14:25:25 428

原创 显示年月日(第三章第二题)

#include using namespace std;class Date{public:Date(int,int,int);Date(int,int);Date(int);Date();void display();private:int month;int day;int year;};Date::Date(int m,int d,int y):month(m)

2015-04-20 14:21:22 367

原创 将类定义放在头文件arraymax.h中(第二章第五题)

#include#include"xt8-5.h"int main(){Array_max arrmax;arrmax.set_value();arrmax.max_value();arrmax.show_value();return 0;}#includeusing namespace std;#includ

2015-04-07 19:32:36 2908

原创 在类体内申明成员函数(第二章第三题)

#includeusing namespace std;class Time{public:void set_time(void);void show_time(void);private:int hour;int minute;int sec;};void Time::set_time(void){c

2015-04-07 19:01:48 634

原创 在类中增加一个对数据成员赋初值的成员函数(第二章第四题)

#includeusing namespace std;#include "xt8-4.h"int main(){Student stud;stud.set_value();stud.display();return 0;}或:#include using namespace std;void Stud

2015-04-07 18:55:37 2984

原创 将数据成员改为私人的(第二章第二题)

#includeusing namespace std;class Time{public:void set_time(void){cin>>hour;cin>>minute;cin>>sec;}void show_time(void){cout<<hour<<":"<<minute<<":"<<sec<<endl;}private:int hour;int minut

2015-04-07 18:03:26 2190

原创 从键盘输入时.分.秒(第二章第一题)

#includeusing namespace std;class Time{public:int hour;int minute;int sec;};Time t;void set_time(void){cin>>t.hour;cin>>t.minute;cin>>t.sec;}void show_time(void){cout<<t.hour<<":"<<t.mi

2015-04-07 17:44:19 822

原创 修改文章2

原:#includeusing namespace std;int main(){int a, b;c=add(a,b)cout<<"a+b"<<c<<endl;return 0; }int add(int x,int y);{z=x+y;return(z);}改:#includeusing namespace std;int main(){int a,

2015-04-07 17:28:42 354

原创 代码

#includeusing namespace std;class A{  double lengh,width,height;public:  A(){lengh=width=height=0;}  void input();  void output();}  A::void input()  {    cout    cin>>lengh;

2015-03-29 13:20:15 275

原创 用同一个函数名对n个数据进行从小到大排序 用函数模板

#include using namespace std;template void sort(T* a, int n){ int t; T temp;  for (int i=0; i {   t=i;  for (int j=i+1; j  {    if (*(a+t)>*(a+j))    t=j;   }   temp=*(a+

2015-03-29 12:55:49 10992

原创 用同一个函数名对n个数据进行从小到大排序

#include using namespace std;template void sort(T* a, int n){ int t; T temp;  for (int i=0; i {   t=i;  for (int j=i+1; j  {    if (*(a+t)>*(a+j))    t=j;   }   temp=

2015-03-29 12:51:47 6355

原创 有5个字符串,要求对他们按由小到大 string

#include #include using namespace std;int main(){ int i; string str[5]; void sort(string s[]); cout for(i=0;i  cin>>str[i];                      sort(str); cout for(i=0;i

2015-03-29 12:46:43 5067

尚硅谷SSM整合视频(SSM整合开发是目前企业流行使用的框架整合方案)

本视频基于Maven+SpringMVC+Spring+MyBatis+Bootstrap的组合,快速开发一个完整的CRUD功能,视频除过对框架组合的基本使用外,还涉及到许多的开发细节:Bootstrap搭建页面,MyBatis逆向工程使用,Rest风格的URI,@ResponseBody注解完成AJAX,AJAX发送PUT请求的问题,jQuery前端校验,JSR303后端校验等。

2017-08-09

批量修改文件名

文件夹里有多个文件,想批量同时修改它们。

2017-08-08

myeclipse2017安装包和破解

myeclipse2017安装包和激活文件

2017-08-05

PPT、简历模板

PPT、简历模板

2017-08-04

设计模式实训教程代码和类图

设计模式实训教程代码和类图

2017-05-05

空空如也

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

TA关注的人

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