第三章
努力爱上代码的boy
这个作者很懒,什么都没留下…
展开
-
第三章第三题
#include using namespace std; class Date { public: Date (int m=1,int d=1,int y=2005):month(m),day(d),year(y){}; void display(); private: int month; int day; int year; }; void Date::di原创 2015-04-22 11:00:56 · 148 阅读 · 0 评论 -
第三章第五题
#include using namespace std; class Student {public: Student(int n,float s):num(n),score(s){} int num; float score; }; void main() {Student stud[5]={ Student(101,78.5),Stude原创 2015-04-22 12:14:49 · 210 阅读 · 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::Compa原创 2015-04-22 12:30:03 · 166 阅读 · 0 评论 -
第三章第十一题
#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-22 12:27:31 · 209 阅读 · 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-22 12:24:38 · 214 阅读 · 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 num;原创 2015-04-22 12:21:12 · 188 阅读 · 0 评论 -
第三章第四题
#include using namespace std; class Student { public: void get_student(); void display(); private: int num; int score; }; void Student::get_student() { cin>>num>>score; } vo原创 2015-04-22 11:21:28 · 161 阅读 · 0 评论 -
类的相关图解
图解原创 2015-04-20 22:17:52 · 180 阅读 · 0 评论 -
第三章第十题
#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;原创 2015-04-22 12:26:17 · 163 阅读 · 0 评论 -
第三章第七题
#include using namespace std; class Student {public: Student(int n,float s):num(n),score(s){} void change(int n,float s) const {num=n;score=s;} void display() const {cout private:原创 2015-04-22 12:18:02 · 187 阅读 · 0 评论