/*未使用模板 #include using namespace std; void swap(int &rx,int &ry) { int temp=rx; rx=ry; ry=temp; } void swap(float&ra,float &rb) { float temp=ra; ra=rb; rb=temp; } void swap(double&a,double &b) { double temp=a; a=b; b=temp; } int main() { int x=2,y=5; cout<<"交换前,x:"< using namespace std; template Tswap(Type &rx,Type &ry) { Type temp=rx; rx=ry; ry=temp; } int main() { int x=2,y=5; cout<<"交换前,x:"<