- 博客(23)
- 收藏
- 关注
原创 3.12
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:02:54 271
原创 3.10
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
2015-04-20 22:02:30 284
原创 3.11
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
2015-04-20 22:02:19 234
原创 3.9
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
2015-04-20 22:00:36 230
原创 3.8
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}private:in
2015-04-20 22:00:05 289
原创 3.7
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()void display()const{
2015-04-20 21:59:19 248
原创 3.6
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:in
2015-04-20 21:59:01 251
原创 3.5
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;i
2015-04-20 21:57:52 208
原创 3.4
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}int
2015-04-20 21:57:11 235
原创 第三章
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),
2015-04-20 21:54:45 228
原创 2.6
#include #include"v_sum.h"using namespace std;int main() {v_sum v1,v2,v3;int v_sum1,v_sum2,v_sum3;v1.get();v_sum1=v1.getv();v2.get();v_sum2=v2.getv();v3.get();v_sum3=v3.getv();
2015-04-07 13:09:12 290
原创 2.5
#includeusing namespace std;class array_max{public:void set_value();void max_value();void show_value();private:int array[10];int max;};#include#include"array_max.h"using na
2015-04-07 13:08:30 243
原创 2.4
#includeusing namespace std;class student{public:void display();int num;string name;char sex;};#include#include"student.h"void student::display(){coutcoutcout}
2015-04-07 13:05:35 225
原创 2.3
#includeusing namespace std;class Time{public:void cin_Time();void cout_Time();private:int hour; int minute; int sec; };int main(){Time t;t.cin_Time();t.cout
2015-04-07 13:04:53 208
原创 2.2
#includeusing namespace std;class Time{public:void cin_Time(){cin>>hour>>minute>>sec;}void cout_Time(){cout}private:int hour; int minute; int sec; };int
2015-04-07 13:03:36 226
原创 1.14
#includeusing namespace std;templateQ sort(Q a[],Q n,Q temb){ int i,j; for(i=0;i { for(j=0;j { if(a[i]{temb=a[i];a[i]=a[i-1];a[i-1]=temb; }
2015-04-07 13:00:50 283
原创 1.13
#includeusing namespace std;template Q paixu(Q*a,int n) { for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(a[i]<a[j]){
2015-04-07 12:54:46 232
原创 1.12
#include#includeusing namespace std;void bubble_sort(string a[],int n){int i,j;string temb;for(i=0;i{for(j=0;j{ if(a[j]>=a[j-1]) {temb=a[j];a[j]=a[j-1];a[j-1]=temb; }
2015-04-07 12:42:21 119
原创 1.11
#include#includeusing namespace std;int main(){string str;cin>>str;int i,j;int length=sizeof(str); for(i=length-1;i>=0;i--) { cout }return 0;}
2015-04-07 12:41:54 297
原创 1.10
#include #include using namespace std;int main(){ string string1; string string2; cout << "input string1:" << endl; cin >> string1; cout << "input string2:" << endl; cin >> string2; cout <<
2015-04-07 12:38:06 465
原创 1.9
#include using namespace std;int main(){ void sort(int &,int &,int &); int a,b,c; cout<<"请输入三个正整数"; cin>>a>>b>>c; sort(a,b,c); cout<<a<<" "<<b<<" "<<c<<endl;}void sort(int &i,int &j,int &k)
2015-04-07 12:37:37 205
原创 1.8
#include "iostream"using namespace std;void sort(int a,int b){ int temp; if(a<b) {temp=a;a=b;b=temp;}}int main(){ void sort(int x,int y,int z); int a,b; cin>>a>>b;
2015-04-07 12:36:36 275
原创 1.7
7.#includeusing namespace std;int max(int a,int b,int c=0){ return a>b ? (a>c ? a:c):(b>c ? b:c);}int main(void){int a,b,c;cin>>a>>b>>c;cout<<max(a,b,c)<<endl;return 0;}8.#include "i
2015-03-23 23:11:23 232
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人