第四章
披星戴月_blog
前端
展开
-
4.21
#include #include using namespace std; class student{ public: student(int nu,string na,double m); void disp(); private: int number; string name; double mark; static int people; static double su原创 2015-06-04 22:19:08 · 316 阅读 · 0 评论 -
4.19&&4.20
#include using namespace std; class book{ public: book(int q); void disp(); private: int qu; int price; }; book::book(int q) { qu=q; price=10*q; } void book::disp() { cout<<"qu*price="<<qu*pric原创 2015-06-04 21:42:26 · 327 阅读 · 0 评论 -
4.17
#include using namespace std; class exam{ public: exam(int n,int s) { number=n; score=s; } void get_x() { cout<<number<<' '<<score<<endl; } private: int number; int score; }; int main()原创 2015-05-06 16:52:21 · 321 阅读 · 1 评论 -
4.22
#include #include using namespace std; class dot{ public: dot(double a,double b); friend double dist(dot &,dot &); void disp(); private: double x; double y; }; dot::dot(double a, double b) { x=a原创 2015-06-04 23:25:45 · 293 阅读 · 0 评论 -
4.18
#include using namespace std; class exam{ public: exam(int n,float s) { number=n; score=s; } void max(exam *ob) { float big=ob->get_sco(); int i; for(i=1;i<6;i++) { ob++; if(bigget_sco()) big=ob->get原创 2015-05-23 20:00:12 · 264 阅读 · 0 评论