Problem1386--类的练习--类模板

1386: 类的练习--类模板

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

声明一个类模板,利用它分别实现两个整数、浮点数和字符的比较,求出大数和小数。

主函数中如下创建

Compare<int> cmp1(3,4);

Compare<float> cmp2(45.78,93.6);

Compare<char> cmp3('a','A');

那么输出为:

4 is the Maximum of two inteder numbers.
3 is the Minimum of two inteder numbers.

93.6 is the Maximum of two float numbers.
45.78 is the Minimum of two float numbers.

a is the Maximum of two characters.
A is the Minimum of two characters.




Sample Output

4 is the Maximum of two inteder numbers.
3 is the Minimum of two inteder numbers.

93.6 is the Maximum of two float numbers.
45.78 is the Minimum of two float numbers.

a is the Maximum of two characters.
A is the Minimum of two characters.


Source/Category

 

[Submit] [Status]