摘要:
#include<iostream> using namespace std; //用模板实现输出两个数当中最小的值 template<class T> T tmin( T x, T y) { return x<y?x:y; } void main() { int a = 5,b = 10; flo 阅读全文
摘要:
#include<iostream> using namespace std; //用模板实现两个数值交换 template<class T> void tswap( T *x, T *y) { int temp = *x; *x = *y; *y = temp; } //排序模板 template 阅读全文
摘要:
#include<iostream> #include<string> using namespace std; class School { protected: int Number; string Name; //c++中碰到字符数组就用string类型来定义 public: School(i 阅读全文