#include <iostream> #include <cstdlib> using namespace std; template < class T > T maximum( T t1 , T t2 ) { return ( t1 > t2 ) ? t1 : t2; } int main( int argc , char *argv[] ) { cout << "Maximo de 1 y -2 = " << maximum( 1 , -2 ) << endl; cout << "Maximo de 1 y 2.5 = " << maximum < double > ( 1 , 2.5 ) << endl; system("pause"); return 0; }
No hay comentarios:
Publicar un comentario