- 博客(13)
- 收藏
- 关注
原创 c++ 7.11
#include class Date{ public: Date(){} Date(int y,int m,int d) {month=m; day=d; year=y;} void print() {cout<<year<<"."<<month<<"."<<day<<endl; } friend Date operator +(Date &op); private
2015-05-17 13:25:47
381
原创 c++ 6.14
#include using namespace std; const double b=3.14; class base{ public: base(double h1) { h=h1;} virtual void disp()=0; protected: double h; }; class cuboid:public base{ public: cuboid(double h1,d
2015-05-16 19:36:20
414
原创 作业 5.19
#include #include using namespace std; class base{ public: base(string name1,int age1) { name=name1; age=age1;} void show() { cout<<"年龄:"<<age<<endl; cout<<"姓名:"<<name<<endl; } private: stri
2015-05-06 23:09:40
370
1
原创 作业5.18 类的继承和派生
#include #include using namespace std; class person{ public: person(string num1,string name1) { num=num1; name=name1; } void show() {cout<<"姓名:"<<name<<endl; cout<<"编号:"<<num<<endl; }
2015-05-06 14:56:02
571
1
原创 作业 4.22
#include #include using namespace std; class point{ private: int x; int y; public: point(int a,int b) { x=a; y=b; } void show(); friend void dist(point& a,point& b); }; void point::show
2015-04-15 22:34:55
632
1
原创 作业4.21
#include #include using namespace std; class student{ public: student(string name1,string num1,int score1); void show(); static void show_count_sum_ave(); private: string name; int score; static
2015-04-15 16:35:27
362
1
原创 作业4.17
#include using namespace std; class student{ public: void st(int r,int n) {result=r;numble=n; } void show() {cout<<result<<" "<<numble<<endl; } private: int result,numble; }; int main() {
2015-04-14 18:18:49
291
1
原创 作业3.24
#include using namespace std; class Date{ public: Date(int Y,int m,int d) { year=Y; month=m; day=d; } void printDate(); void GetYear() { cout<<year<<endl; } void GetMonth() { cout<<
2015-04-08 17:53:24
278
1
原创 作业3.23
#include using namespace std; class cylinder{ public: cylinder(double r,double h) { R=r; H=h; } double V() { return 3.14*R*R*H; } void Vol(); private: double R; double H; }; void cylind
2015-04-08 17:44:09
420
1
原创 3.22
#include using namespace std; const double p=3.14; class circle{ public: circle(double r1); double area() { return p*r*r; } void show(); private: double r; }; circle::circle(double r1) { r=r1; }
2015-04-06 12:06:28
358
1
原创 2.29
#include #include using namespace std; int main() { int *p; p=new int[20]; p[0]=0,p[1]=1; for(int i=2;i<20;i++) { p[i]=p[i-1]+p[i-2]; } for(i=0;i<20;i++) { cout<<setw(6)<<p[i]; } cout
2015-04-01 23:49:32
398
1
原创 学生类定义
#include #include using namespace std; class student{ public: student(char *name1,char *num1,char *tel1); void show(); private: char *name; char *num; char *tel; }; student::student(char *name1,c
2015-04-01 20:55:28
470
1
原创 作业 2.30
#include #include using namespace std; int sroot(int a) { return sqrt(a); } long sroot(long b) { return sqrt(b); } double sroot(double c) { return sqrt(c); } int main() { int a=4; long b=10000; d
2015-03-31 21:45:21
362
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅