第三章
gan920hp
这个作者很懒,什么都没留下…
展开
-
第3题
#include using namespace std;class Date{public:Date(int=1,int=1,int=2005);void display();private:int month;int day;int year;};Date::Date(int m,int d,int y):month(m),day(d),year(y){}void Date::display(原创 2015-04-27 21:59:55 · 570 阅读 · 0 评论 -
第11题
#include using namespace std; class Time; class Date {public: Date(int,int,int); friend Time; private: int month; int day; int year; }; Date::Date(int m,int d,int y):m原创 2015-04-27 22:35:46 · 444 阅读 · 0 评论 -
第10题
#include using namespace std; class Date; class Time { public: Time(int ,int ,int ); friend void display(const Date &,const Time &); private: int hour; int minute; int sec; }; Time::Time原创 2015-04-27 22:35:51 · 300 阅读 · 0 评论 -
第九题
#include using namespace std; class Product {public: Product(int n,int q,float p):num(n),quantity(q),price(p){}; void total(); static float average(); static void display();原创 2015-04-27 22:33:01 · 344 阅读 · 0 评论 -
第八题
#include using namespace std; class Student { public: Student(int n,float s):num(n),score(s){} void change(int n,float s) { num=n; score=s; } void display() { cout } private: int n原创 2015-04-27 22:31:15 · 323 阅读 · 0 评论 -
第七题
一. #include using namespace std; class Student { public: Student(int n,float s):num(n),score(s){} void change(int n,float s) { num=n; score=s; } //void display() void display()const {原创 2015-04-27 22:22:20 · 352 阅读 · 0 评论 -
第6题
#include using namespace std; class Student { public: Student(int n,float s):num(n),score(s){} void change(int n,float s) { num=n; score=s; } void display() { cout } private: int num原创 2015-04-27 22:19:09 · 340 阅读 · 0 评论 -
第5题
#include using namespace std;class Student{public:Student(int n,int s):num(n),score(s){}int num;int score;};void max(Student *a){ int i,k=0,max_score=a[0].score; for(i=1;imax_score) {max_score=a[i].sc原创 2015-04-27 22:18:24 · 482 阅读 · 0 评论 -
第4题
#include using namespace std;class Student {public: Student(int n,float s):num(n),score(s){} void display(); private: int num; float score; };void Student::display() {cout<<num<<" "<<score<<endl;}int原创 2015-04-27 22:17:09 · 437 阅读 · 0 评论 -
第12题
#include using namespace std; template class Compare { public: Compare(numtype a,numtype b); numtype max(); numtype min(); private: numtype x,y; }; template Compare::Compare(numtyp原创 2015-04-27 22:38:19 · 359 阅读 · 0 评论