自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 第二题

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

2015-06-09 21:00:00 257

原创 第一题

#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

2015-06-09 20:22:13 225

原创 第5题

#include using namespace std;class Shape{public: virtual double area() const =0; };class Circle:public Shape{public:Circle(double r):radius(r){}

2015-06-09 20:15:50 248

原创 第4题

#include using namespace std;class Shape{public: virtual double area() const =0; };class Circle:public Shape{public:Circle(double r):radius(r){}

2015-06-09 19:15:18 252

原创 第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 Circ

2015-06-09 18:57:05 254

原创 第10题

#include #include using namespace std;class Teacher {public: Teacher(int,char [],char); void display(); private:

2015-06-08 22:51:50 242

原创 第4题

#include using namespace std;class Student{public: void get_value(); void display( ); protected : int num; char name[10]; char

2015-06-08 22:36:44 229

原创 第3题

#include using namespace std;class Student {public: void get_value(); void display( ); protected : int num; c

2015-06-08 22:33:44 213

原创 第二题

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

2015-06-08 22:29:05 218

原创 第一题

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

2015-06-08 22:10:47 177

原创 第七题

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

2015-05-12 21:02:04 168

原创 第六题

#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-12 20:58:58 253

原创 第五题

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

2015-05-12 20:54:32 374

原创 第四题

#include class Matrix {public:Matrix(); friend Matrix operator+(Matrix &,Matrix &); void input(

2015-05-12 20:26:16 218

原创 第三题

#include class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex operator+(int &i); friend Compl

2015-05-12 20:20:32 305

原创 第二题

#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-12 20:10:43 208

原创 第一题

#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-12 20:02:10 194

原创 第6题

#include using namespace std;class Box{public: void get_value(); float volume(); void display(); public: float lengh; float width; float height; };void Box::get_value(){ cout<<"pl

2015-04-20 21:40:00 331

原创 第12题

#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

2015-04-20 17:59:02 338

原创 第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)

2015-04-20 17:18:51 170

原创 第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::

2015-04-20 17:15:51 232

原创 第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:

2015-04-20 17:09:32 306

原创 第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;} pri

2015-04-20 17:08:22 202

原创 第5题

#include using namespace std;class Student {public: Student(int n,float s):num(n),score(s){} int num; float score; };int main(){Student stud[5]={ Student(1,85),Student(2,85),Student(

2015-04-20 17:05:12 270

原创 第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<<"

2015-04-20 16:58:24 239

原创 第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(

2015-04-20 16:56:49 208

原创 第14题

#include #include using namespace std;template void sort(T a[]) {int i,j,min; T t; for(i=0;i<5;i++) {min=i; for (j=i+1;j<5;j++) if(a[min]>a[j]) min=j; t=a[i]; a[

2015-04-20 16:22:00 200

原创 第3题

#include using 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) {cin>>h

2015-04-19 23:09:25 311

原创 第2题

#include using namespace std;class Time {public: void set_time(void) {cin>>hour; cin>>minute; cin>>sec; } void show_time(void) {cout<<hour<<":"<<minute<<":"<<sec

2015-04-19 23:05:49 340

原创 第13题

#include #include using namespace std;int main(){ long c[5]={10000,-99999, 22222,-5555, 7777}; int a[5]={1,3,0,2,6}; float b[5]={2.7, 5.6, 2.5, 9.6, -2.1 }; void sort(int []);void sort(

2015-04-19 22:44:23 169

原创 第12题

#include #include using namespace std;int main(){ string x[5],t; int n; for(int i=0;i<5;i++){ cin>>x[i]; } for(int i=0;i<5;i++){ for(int j=i+1;j<5;j++){ if(x[i]>x[j]){ t=x[i]; x

2015-04-19 22:31:24 212

原创 第11题

#include #include using namespace std;int main(){ string str; int i,n; char temp; cout<<"请输入一个字符串:"; cin>>str; n=str.size(); for(i=0;i<n/2;i++) {temp=str[i];str[i]=str[n-i-1];str[n-i-

2015-04-19 22:11:37 200

原创 第10题

#include #include using namespace std;int main(){ string string1="abc"; string string2="def"; cout<<"string1="<<string1<<endl; cout<<"string2="<<string2<<endl; string1=string1+string2; c

2015-04-19 22:06:26 187

原创 第9题

#include using namespace std;int main(){void sort(int &,int &,int &); int a,b,c,a1,b1,c1; cout<<"请输入三个数:"; cin>>a>>b>>c; a1=a;b1=b;c1=c; sort(a1,b1,c1); cout<<a<<" "<<b<<" "<<c<<" 从小到大的顺序为 ";

2015-04-19 21:49:13 237

原创 第8题

#include using namespace std;void change(int &r1,int &r2){ int temp; temp=r1; r1=r2; r2=temp; }int main(){ int a,b; cin>>a>>b; if(a<b) change(a,b); cout<<"max="<<a<<" min="<

2015-04-19 21:35:49 200

原创 第7题

#include using namespace std;int main(){int max(int a,int b,int c=0); int a,b,c; cin>>a>>b>>c; cout<<"max(a,b,c)="<<max(a,b,c)<<endl; cout<<"max(a,b)="<<max(a,b)<<endl; return 0;}int max(in

2015-04-19 21:20:20 192

空空如也

空空如也

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

TA关注的人

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