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 · 217 阅读 · 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 · 240 阅读 · 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 · 234 阅读 · 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 · 197 阅读 · 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 · 216 阅读 · 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(nu原创 2015-04-20 22:18:42 · 243 阅读 · 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 · 222 阅读 · 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 · 198 阅读 · 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 · 217 阅读 · 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 · 184 阅读 · 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 · 211 阅读 · 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 · 222 阅读 · 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 · 203 阅读 · 0 评论
分享