摘要: //函数模版使用//函数模版标准不支持参数默认值#include<iostream>#include<cstring>using namespace std;template <typename T>void sort(T* a,int n)//普通冒泡排序{ bool changed; do { changed=false; for(int i=1;i<n;i++) { if(a[i]<a[i-1]) { swap(a[i],a[i-1]); changed=true; } } --n; } while(changed);}template & 阅读全文
posted @ 2012-10-13 11:48 真爱无限 阅读(230) 评论(0) 推荐(0) 编辑