摘要:
源程序: #include<iostream>using namespace std;template<typename T>class Test{public: Test(T num) { k += num; } Test() { k += 1; } static void incrementK( 阅读全文
posted @ 2020-02-05 21:08
bobo哥
阅读(142)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>#include<string>using namespace std;template<class T1, class T2>class Pair{public: T1 first; T2 second; Pair(T1 k, T2 v) :first 阅读全文
posted @ 2020-02-05 21:05
bobo哥
阅读(166)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std;template<class T>class TestClass{public: T buffer[10]; T getData(int j);};template <class T>T TestClass<T>: 阅读全文
posted @ 2020-02-05 21:02
bobo哥
阅读(104)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>#include<string>using namespace std;template<class T1, class T2>class Pair{public: T1 first; T2 second; Pair(T1 k, T2 v) :first 阅读全文
posted @ 2020-02-05 20:59
bobo哥
阅读(128)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std;template<class T>T Max(T a, T b){ cout << "Template Max 1" << endl; return 0;}template<class T,class T2>T M 阅读全文
posted @ 2020-02-05 20:56
bobo哥
阅读(141)
评论(0)
推荐(0)
摘要:
源程序: #include<iostream>using namespace std;class myDate{public: myDate(); myDate(int, int, int); friend ostream & operator<<(ostream & os, const myDat 阅读全文
posted @ 2020-02-05 20:48
bobo哥
阅读(98)
评论(0)
推荐(0)
摘要:
源程序: #include <iostream>#include <string>using namespace std;template <typename T>int myCompare(const T& left, const T& right){ if (left<right) { retu 阅读全文
posted @ 2020-02-05 20:45
bobo哥
阅读(137)
评论(0)
推荐(0)
摘要:
源程序: #include <iostream>using namespace std;template<class T> //类类型Tvoid Swap(T &x, T &y) //可以交换类对象{ T tmp = x; x = y; y = tmp;}class myDate{public: m 阅读全文
posted @ 2020-02-05 20:13
bobo哥
阅读(142)
评论(0)
推荐(0)
摘要:
源程序: #include <iostream>using namespace std;template <typename T>T abs(T x){ return x<0 ? -x : x;}int main(){ int n = -5; int m = 10; double d = -.5; 阅读全文
posted @ 2020-02-05 20:00
bobo哥
阅读(145)
评论(0)
推荐(0)
摘要:
源程序: #include <iostream>#include <fstream>using namespace std; class triangle{private: int a, b, c; double area;public: triangle(int aa, int bb, int c 阅读全文
posted @ 2020-02-05 19:49
bobo哥
阅读(155)
评论(0)
推荐(0)

浙公网安备 33010602011771号