![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++第三章
i_3ummer
这个作者很懒,什么都没留下…
展开
-
3-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-20 14:46:43 · 170 阅读 · 0 评论 -
3-7(5)
#include using namespace std;class Student{public: Student(int n,float s):num(n),score(s){} //void change(int n,float s) void change(int n,float s)const { num=n; score=s; } /原创 2015-04-20 17:32:22 · 189 阅读 · 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: i原创 2015-04-20 17:17:11 · 185 阅读 · 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<<" "<原创 2015-04-20 16:48:28 · 158 阅读 · 0 评论 -
3-7(2)
#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}//void change(int n,float s)void change(int n,float s)const{num=n; score=s;}//void display()void display()cons原创 2015-04-20 15:58:33 · 169 阅读 · 0 评论 -
3-12
#include using namespace std;templateclass Compare{ public: Compare(numtype a,numtype b); numtype max(); numtype min(); private: numtype x,y;};templateCompare::Compare(nu原创 2015-04-20 22:18:42 · 192 阅读 · 0 评论 -
3-7(4)
#include using namespace std;class Student{public:Student(int n,float s):num(n),score(s){}//void change(int n,float s)void change(int n,float s)const{num=n;score=s;}//void display()void display()const原创 2015-04-20 16:26:21 · 176 阅读 · 0 评论 -
3-7(3)
#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(){ coutchange(101,80.5); p->display(); return 0;}原创 2015-04-20 16:23:27 · 164 阅读 · 0 评论 -
3-4
#include using namespace std;class Student{public:Student(int n,int s):num(n),score(s){}void display();private:int num;int score;};void Student::display(){ cout<<num<<" "<<score<<endl;}int main(){Stud原创 2015-04-20 15:16:18 · 163 阅读 · 0 评论 -
3-10
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;};T原创 2015-04-20 17:29:25 · 143 阅读 · 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<<" "<<score<<endl;}private:int num;flo原创 2015-04-20 15:47:44 · 165 阅读 · 0 评论 -
3-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-20 15:24:48 · 175 阅读 · 0 评论 -
3-11
#include using namespace std;class Student{public: Student(int n,float s):num(n),score(s){} //void change(int n,float s) void change(int n,float s)const { num=n; score=s; } /原创 2015-04-20 22:10:48 · 163 阅读 · 0 评论