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)

cpoint

摘要: 1 #include 2 #include 3 using namespace std; 4 class CPoint 5 { 6 public: 7 int cpoint() 8 { 9 x = 0;10 y = 0;11 return 0;12 }13 int cpoint(double a , double b)14 {15 x=a;16 y=b;17 return 0;18 }19 double GetX()20 {21 ... 阅读全文

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

change

摘要: 1 #include 2 using namespace std; 3 int main() 4 { 5 double a; 6 cin>>a; 7 cout11 #include12 #define pi 3.141513 using namespace std;14 int main()15 {16 int conver(double & a,double & b);17 int conver(double a,double b,double c[]);18 double a=0,b=0;19 double c[2]={0,0};2... 阅读全文

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

band

摘要: 1 #include 2 #include 3 using namespace std; 4 int calculate(double amount[],int year,double rate,double in[],double p[],double* m,double * t) 5 { 6 double mon,tot,mr; 7 int mm,k; 8 mm = year * 12; 9 mr = rate / mm;10 m = & mon;11 t = & tot;12 mon = amount[0] * mr* pow(1... 阅读全文

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

age

摘要: 1 #include 2 #include 3 #define pi 3.14 4 using namespace std; 5 int main() 6 { 7 int computeday(int y[],int m[],int day[]); 8 double compute_physiological_index(int d); 9 double compute_emotional_index(int d);10 double compute_mentality_index(int d);11 int year[2];12 int mo... 阅读全文

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

acount

摘要: 1 #include 2 using namespace std; 3 class account 4 { 5 public: 6 int de( int i, double b, double a) 7 { 8 id = i; 9 balance = b;10 annuleinterestrate = a;11 return 0;12 }13 int visit( int b)14 {15 switch (b)16 { 17 case 1:... 阅读全文

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

wage

摘要: 1 #include 2 using namespace std; 3 int main() 4 { 5 double wage1,wage2,time; 6 cout>time>>wage1; 8 wage2=0; 9 if(time>60)10 wage2=(time-60)*3*wage1+20*wage1*1.5+40*wage1;11 else if(time>40)12 wage2=(time-40)*1.5*wage1+40*wage1;13 else14 wage2=time*wa... 阅读全文

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

code

摘要: 1 #include 2 #include 3 typedef struct LNode 4 { 5 int code,number; 6 struct LNode * next; 7 }LNode,* LinkList; 8 int Insert_L(LinkList L) 9 {10 int n;11 LNode * s,* p;12 printf("Please Input the number:\n"); //输入参与人数n;13 scanf("%d",& n);14 printf("Please In... 阅读全文

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

score

摘要: 1 #include 2 using namespace std; 3 class student{ 4 public: 5 int Input() 6 { 7 for(i=0;i>number[i];11 for(j=0;j>score[i][j];13 }14 return 0;15 }16 17 int calculateall()18 {19 for(i=0;i>n;66 cout<<"The class's average is: "<<stu1.... 阅读全文

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

transport

摘要: #includeusing namespace std;int transport(int a){ int d=0; if(a0) { a=a*10+1; d--; } return a;}int main(){ int a,b; cin>>a; b=transport(a); if(b==0) cout<<"error!"<<endl; else cout<<b<<endl; return 0;} 阅读全文

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

const

摘要: 1 #include 2 using namespace std; 3 int main() 4 { 5 float a,c; 6 float const b=1.60934; 7 cin>>a; 8 c=a/b; 9 cout<<c<<endl;10 return 0;11 } 阅读全文

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

导航