上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 54 下一页
摘要: 源程序: #include <iostream>#define N 10using namespace std; template <typename T> T sum_array(T a[], int n){ int i,size; T sum=0; cout << "您想求数组前几项的和,请输入 阅读全文
posted @ 2020-02-06 09:53 bobo哥 阅读(146) 评论(0) 推荐(0)
摘要: 源程序: 用三种排序:冒泡排序,直接插入排序,直接选择排序 #include <iostream>#define N 5using namespace std; template <typename T>//冒泡排序 /*void bubble_sort(T a[], int n){ int i, 阅读全文
posted @ 2020-02-06 09:02 bobo哥 阅读(133) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;template <class T> class max{private: T x, y;public: max(T a, T b) { x = a; y = b; } T compare() { return 阅读全文
posted @ 2020-02-05 23:31 bobo哥 阅读(111) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;template <class T> class Sample{ T n;public: Sample(T i) { n = i; } int operator ==(Sample &);}; template 阅读全文
posted @ 2020-02-05 23:05 bobo哥 阅读(132) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;template <class T> void f(T a[],int n){ T t; for (int i = 0; i < n / 2; i++) { t = a[i]; a[i] = a[n-i-1]; 阅读全文
posted @ 2020-02-05 22:30 bobo哥 阅读(118) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;template <class T> class A{private: T x, y, s;public: A(T a, T b) { x = a; y = b; s = x + y; } void show() 阅读全文
posted @ 2020-02-05 21:59 bobo哥 阅读(121) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;template <class T> class f{public: T x, y; void f1(T a, T b) { x = a; y = b; } T max() { return (x > y) ? 阅读全文
posted @ 2020-02-05 21:48 bobo哥 阅读(148) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>#include <string>using namespace std;template<class T>class TBase{ T data1;public: void print() { cout << "TBase::" << data1 < 阅读全文
posted @ 2020-02-05 21:29 bobo哥 阅读(300) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>#include <string>using namespace std;template<class T>class TBase{ T data1;public: void print() { cout << "TBase::" << data1 < 阅读全文
posted @ 2020-02-05 21:26 bobo哥 阅读(120) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;template <int i>class TestClass{public: int buffer[i]; int getData(int j);};template <int i>int TestClass< 阅读全文
posted @ 2020-02-05 21:20 bobo哥 阅读(165) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 54 下一页