pex7_1.cpp

来自「数据结构C++代码,经典代码,受益多多,希望大家多多支持」· C++ 代码 · 共 27 行

CPP
27
字号
#include <iostream.h>
#pragma hdrstop

#include "wex7_1.h"

void main (void)
{
	// test Max with int, float and string data
	int m = 10, n = 20;
	float x = -4.5, y = 2.6;
	char  *str1 = "smaller", *str2 = "larger";
	
	cout << "Max of 10 and 20 is " << Max(m,n) << endl;
	cout << "Max of -4.5 and 2.6 is " << Max(x,y) << endl;
	cout << "Max of 'smaller' and 'larger' is '"
		 << Max(str1,str2) << '\'' << endl;
}
	
/*
<Run>

Max of 10 and 20 is 20
Max of -4.5 and 2.6 is 2.6
Max of 'smaller' and 'larger' is 'smaller'
*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?