2013年12月26日

通讯录

摘要: 1 #include 2 using namespace std; 3 //mine查看别人并修改自己的相关参数姓名、电话、增加自己或删除自己; 4 //先登录自己的,才能进行对通讯录的相关操作; 5 //adm删除任何人、增加任何人、修改任何人 6 class base 7 { 8 public: 9 base(char n[] = "",char p[] = "") 10 { 11 strcpy(name,n); 12 strcpy(phone,p); 13 } 14 ~base(){} 15 vo... 阅读全文

posted @ 2013-12-26 17:03 了发发 阅读(208) 评论(0) 推荐(0)

max

摘要: 1 #include 2 using namespace std; 3 float max(int a,float b) 4 { 5 if(a>b) 6 return a; 7 return b; 8 } 9 int main()10 {11 int a;12 float b,c;13 cin>>a>>b;14 c=max(a,b);15 cout<<c<<endl;16 } 阅读全文

posted @ 2013-12-26 17:01 了发发 阅读(203) 评论(0) 推荐(0)

shape

摘要: #include#define pi 3.14using namespace std;class cstereoshape{public: virtual double getarea() = 0; virtual double getvolume() = 0;};class ccube : public cstereoshape{public: ccube(double l = 0,double w = 0,double h = 0) { length = l; wide = w; high = h; } ~ccu... 阅读全文

posted @ 2013-12-26 17:00 了发发 阅读(163) 评论(0) 推荐(0)

matrix

摘要: #includeusing namespace std;int Input(int a[][100],int b[][100]){ int i,j,n; cout>n; cout>a[i][j]; cout>b[i][j]; return n;}int addMatrix(int a[][100],int b[][100],int c[][100],int n){ int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++) c[i][j]=a[i][j]+b[i][j]; re... 阅读全文

posted @ 2013-12-26 16:59 了发发 阅读(141) 评论(0) 推荐(0)

hello

摘要: 1 #include 2 #include 3 using namespace std; 4 class Person 5 { 6 public: 7 Person(char n[],char i[] = "",char p[] = "") 8 { 9 strcpy(name,n); 10 strcpy(id , i); 11 strcpy(phonenumber , p); 12 } 13 ~Person(){} 14 void print() 15 { 16 ... 阅读全文

posted @ 2013-12-26 16:58 了发发 阅读(163) 评论(0) 推荐(0)

function

摘要: #includeusing std::cout;using std::endl;class pu{public: pu(double r = 0,double i = 0) { real = r; im = i; } void setr(double r ) { real = r; } void seti(double i) { im = i; } double putr() { return real; } double puti() { ... 阅读全文

posted @ 2013-12-26 16:57 了发发 阅读(162) 评论(0) 推荐(0)

float

摘要: #includeusing namespace std;typedef struct plural{ double a; double b;};int main(){ double product(double c,double d); plural product(plural e,plural f); double c,d; plural e,f,g; cout > c >> d; cout > e.a >> f.a; cout > e.b >> f.b; g = product(e,f); cout << prod... 阅读全文

posted @ 2013-12-26 16:56 了发发 阅读(185) 评论(0) 推荐(0)

first

摘要: #includeusing namespace std;int min(int a,int b){ if(a>b) return b; return a;}int main(){ int a,b,c; cin>>a>>b; c=min(a,b); cout<<c<<endl; return 0;} 阅读全文

posted @ 2013-12-26 16:55 了发发 阅读(92) 评论(0) 推荐(0)

fan

摘要: #includeusing namespace std;int main(){ int ComputeDay(int year, int day[]); int year,day[12]; int i; char month[12][15]={"January","February","March","April","May","June","July","August","September","Octo 阅读全文

posted @ 2013-12-26 16:54 了发发 阅读(164) 评论(0) 推荐(0)

day

摘要: 1 #include 2 using namespace std; 3 int main() 4 { 5 int ComputeDay(int year, int day[]); 6 int year,day[12]; 7 int i; 8 char month[12][15]={"January","February","March","April","May","June","July","August","Septemb 阅读全文

posted @ 2013-12-26 16:53 了发发 阅读(126) 评论(0) 推荐(0)

导航