#include #include using namespace std; template void show3(T a,T b,T c) { cout< void sort3(T& a,T& b, T& c) { if(a>b) { //swap a and b T temp; temp=a; a=b; b=temp; }//swap a and b if(b>c) { //swap b and c T temp; temp=b; b=c; c=temp; }//swap b and c if(a>b) { //swap a and b T temp; temp=a; a=b; b=temp; }//swap a and b }//sort3 int main() { int x=20,y=5,z=3; sort3(x,y,z); //T is int show3(x,y,z); double d1=5.5, d2=-20, d3=0.25; sort3(d1,d2,d3); //T is double show3(d1,d2,d3); string name1="Mary", name2="Bill", name3="Jay"; sort3(name1,name2,name3); //T is string show3(name1,name2,name3); system("pause"); return 0; }//main