自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 P269 6

#include #include using namespace std; struct student {int num; char name[20]; double score; };int main() {student stud[3]={1001,"Li",78,1002,"Wang",89.5,1004,"Fun",90},stud1[3]; char c[

2015-06-10 20:01:15 445

原创 P269 5

#include #include using namespace std; struct staff {int num; char name[20]; int age; double pay; }; int main() {staff staf[7]={2101,"Li",34,1203,2104,"Wang",23,674.5,2108,"Fun",54,77

2015-06-10 19:58:28 379

原创 P269 3

#include #include using namespace std; int main() { for(int n=1;n<8;n++) cout<<setw(20-n)<<setfill(' ')<<" "<<setw(2*n-1)<<setfill('B')<<"B"<<endl; return 0; }

2015-06-10 19:49:54 334

原创 P269 2

#include #include using namespace std; int main() {float a[5];cout<<"input data:";for(int i=0;i<5;i++) cin>>a[i]; cout<<setiosflags(ios::fixed)<<setprecision(2); for(i=0;i<5;i++) cout<<s

2015-06-10 19:47:41 431

原创 P268 1

#include #include using namespace std; int main() {double a,b,c,s,area; cout<<"please input a,b,c:"; cin>>a>>b>>c;if (a+b<=c)cerr<<"a+b<=c,error!"<<endl; else if(b+c<=a)cerr<<"b+c<=a,err

2015-06-10 19:44:57 472

原创 P225 5

#include using namespace std;//定义抽象基类Shape class Shape {public: virtual double area() const =0;//纯虚函数};//定义Circle(圆形)类class Circle:public Shape {public: Circle(double r):radius(r){}//结构函数v

2015-06-10 19:40:53 462

原创 P225 4

#include using namespace std; //定义抽象基类Shape class Shape {public: virtual double area() const =0;//纯虚函数};//定义Circle类class Circle:public Shape {public: Circle(double r):radius(r){}//结构函数virt

2015-06-10 19:26:59 288

原创 P225 3

#include using namespace std; class Point {public: Point(float a,float b):x(a),y(b){} ~Point(){cout<<"executing Point destructor"<<endl;} private: float x; float y; }; class Circle:public

2015-06-10 19:17:28 281

原创 研究生类

#include #include using namespace std; class Student { public: virtual void get()=0; virtual void display()=0; string name; int num; }; class UGraduate :public St

2015-06-02 18:37:01 518

原创 课堂题目修改

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

2015-05-25 21:33:55 394

原创 P202 10

#include #include using namespace std; class Teacher //教师类{public: Teacher(int,char [],char); //声明构造函数void display(); //声明输出函数private: int num; char name[20]; char sex; }; Teacher::T

2015-05-18 13:09:04 303

原创 P202 9

#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 age; char sex; st

2015-05-18 13:08:15 267

原创 P201 8

#include using namespace std; class A { public: A(){cout<<"constructing A "<<endl;} ~A(){cout<<"destructing A "<<endl;} }; class B : public A { public: B(){cout<<"constructing B "<<endl

2015-05-18 13:07:56 695

原创 P200 7

#include using namespace std; class A { public: A(){a=0;b=0;} A(int i){a=i;b=0;} A(int i,int j){a=i;b=j;} void display(){cout<<"a="<<a<<" b="<<b;} private: int a; int b; }; class B :

2015-05-18 13:07:08 600

原创 P198 4

#include using namespace std; class Student//声明基类{public: //基类公用成员void get_value(); void display( ); protected : //基类保护成员int num; char name[10]; char sex; }; void Student::get_value(

2015-05-18 13:06:12 347

原创 P198 3

#include using namespace std; class Student //声明基类{public: //基类公用成员void get_value(); void display( ); protected : //基类保护成员int num; char name[10]; char sex; }; void Student::get_value()

2015-05-18 13:05:25 335

原创 P198 2

#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<<"sex: "<<sex<<end

2015-05-18 13:03:57 273

原创 P198 1

#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<<"sex: "<<sex<<en

2015-05-18 13:03:23 301

原创 时间相加

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

2015-05-11 22:59:57 340

原创 P153 7

#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 display()

2015-04-27 21:32:39 359

原创 课堂题目

#include #include #includeclass String{public:String(){p=NULL;}String(const String &);String(char *str); ~String();String & operator=(const String &);String operator+(const String &);fr

2015-04-27 21:32:37 250

原创 P153 6

#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(){return real;}

2015-04-27 21:31:50 599

原创 P153 5

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

2015-04-27 21:30:57 309

原创 P153 4

#include class Matrix {public: Matrix(); friend Matrix operator+(Matrix &,Matrix &); void input(); void display(); private: int mat[2][3];

2015-04-27 21:30:15 257

原创 P153 3

#include //用VC++时改为∶#include using namespace std; //用VC++时为取消此行class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Co

2015-04-27 21:26:48 331

原创 P153 2

#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 &c2); Comp

2015-04-27 21:26:01 250

原创 P153 1

#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(); private: d

2015-04-27 21:25:17 663

原创 类的图解

2015-04-20 16:16:33 213

原创 P121 12

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

2015-04-20 13:49:02 234

原创 P121 11

#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),yea

2015-04-20 13:46:15 235

原创 P121 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

2015-04-20 13:41:25 244

原创 P121 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 n

2015-04-20 13:37:24 408

原创 P121 8

#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

2015-04-20 13:34:12 645

原创 P120 7

#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;} privat

2015-04-20 13:29:31 348

原创 P120 6

#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:

2015-04-20 13:22:33 544

原创 P120 5

#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),

2015-04-20 13:18:06 379

原创 P119 4

#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<<" "<<s

2015-04-20 13:13:51 374

原创 P119 3

#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(

2015-04-20 13:02:58 299

原创 P118 2

#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

2015-04-20 12:59:03 432

原创 P67 5

//xt2-5-1.cpp(file1.cpp) #include #include "xt2-5.h" int main(){ Array_max arrmax; arrmax.set_value(); arrmax.max_value(); arrmax.show_value(); return 0;}//xt2-5-2.cpp(arraymax.cpp) #in

2015-04-11 12:49:20 397

空空如也

空空如也

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

TA关注的人

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