标签:函数模板
#include <iostream> using namespace std; template<typename T> T max(const T &a,const T &b,const T &c) { T temp=(a>b)?a:b; return (temp>c)?temp:c; } int main(int argc, char *argv[]) { int a=10; int b=22; int c=15; cout<<max(‘a‘,‘b‘,‘c‘)<<endl; cout<<max(a,b,c)<<endl; cout<<max(55.55,11.11,44.44)<<endl; return 0; }
本文出自 “10628473” 博客,请务必保留此出处http://10638473.blog.51cto.com/10628473/1964433
标签:函数模板
原文地址:http://10638473.blog.51cto.com/10628473/1964433