摘要: 1 #include <iostream>//字符串排序 2 #include <string> 3 using namespace std; 4 void main() 5 { 6 void sort(string &,string &,string &); 7 string a,b,c; 8 string a1,b1,c1; 9 cin>>a>>b>>c;10 a1=a;b1=b;c1=c;11 sort(a1,b1,c1);12 cout<<a1<<" "< 阅读全文
posted @ 2013-05-27 17:16 herizai 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<iostream> 3 using namespace std; 4 #define size 5 5 int a[][2]={{2,3},{1,3},{3,1}}; 6 int b[][3]={{1,-2,-3},{2,-1,0}}; 7 8 int r[][3]={{0,0,0},{0,0,0},{0,0,0}}; 9 10 void f(int (*)[2],int (*)[3] )11 {12 for(int i=0;i<3;i++)13 {14 for(int j=0;j<3;... 阅读全文
posted @ 2013-05-27 16:11 herizai 阅读(226) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;class Vector{ int x,y;public: Vector(){};//默认构造函数 Vector(int x1,int y1)//重载构造函数 { x=x1;y=y1; } Vector operator+(Vector v)//成员函数方式重载运算符"+" { Vector tmp;//定义一个tmp对象 tmp.x=x+v.x; tmp.y=y+v.y; return tmp;//返回tm... 阅读全文
posted @ 2013-05-27 14:24 herizai 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<string> 3 using namespace std; 4 //----------------- 5 class GNumber 6 { 7 char chuan[50]; 8 public: 9 void set();10 friend int search (GNumber& str);11 };12 //-------------------13 int search(GNumber& s)14 { 15 int num=0; /... 阅读全文
posted @ 2013-05-27 14:22 herizai 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 面向对象程序设计试题A一、选择题(每小题1分,共10分)1.下列关于内联函数的描述中,错误的是( )。CA. 内联函数主要解决程序的运行效率问题;B. 内联函数的定义必须出现在内联函数第一次被调用之前;C. 内联函数中可以包括各种语句;D. 对内联函数不可以进行异常接口声明;2.下列( )不是构造函数的特征。DA. 构造函数的函数名与类名相同B. 构造函数可以重载C. 构造函数可以设置缺省参数D. 构造函数必须指定类型说明3.关于成员函数特征的下列描述中,( )是错误的。A A. 成员函数一定是内联函数 B. 成员函数可以重载 C. 成员函数可以设置缺省参数值 D. 成员函数可以是静态的4.下 阅读全文
posted @ 2013-05-27 13:19 herizai 阅读(568) 评论(0) 推荐(0) 编辑