第三章
xuehonghao
这个作者很懒,什么都没留下…
展开
-
3.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<<num<<" "<<score<<endl;原创 2015-04-20 21:52:29 · 197 阅读 · 0 评论 -
3.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(numtype a,numty原创 2015-04-20 22:10:02 · 203 阅读 · 0 评论 -
3.5
#include #include using namespace std; class student{ public: student(string nam,int n,int m) { name=nam; num=n; sor=m; } string name; int num; int sor; void max(); }; v原创 2015-04-20 21:48:54 · 258 阅读 · 0 评论 -
3.7
(1) #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()const { cout<<num<<" "<<sc原创 2015-04-20 21:54:34 · 202 阅读 · 0 评论 -
3.8
#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<<num<<" "<<score<<endl;原创 2015-04-20 22:01:27 · 221 阅读 · 0 评论 -
3.4
#include #include using namespace std; class student{ public: student(string nam,int n,int m) { name=nam; num=n; sor=m; } void display() { cout<<"name:"<<name<<endl; co原创 2015-04-20 17:21:23 · 190 阅读 · 0 评论 -
3.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(int h,i原创 2015-04-20 22:06:38 · 178 阅读 · 0 评论 -
3.9
#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(); private: int num; i原创 2015-04-20 22:04:15 · 156 阅读 · 0 评论 -
3.11
#include using namespace std; class Time; class Date { public: Date(int ,int ,int); friend Time; private: int day; int month; int year; }; Date::Date(int d,int m,int y) { int day=d; int month=原创 2015-04-20 22:08:58 · 212 阅读 · 0 评论