* copyright (c) 2014 , 烟台大学计算机学院
* all rights reserved .
* 文件名称 : textst . cpp
* 作者 : 孙旭明
* 完成日期 : 2015年3月12日
* 版本号 : v1.0
* 问题描述: 数值比较,求最大值
* 输出结果: 一个整数
*/
#include <iostream>
using namespace std;
int main()
{
int a,b,max;
cin>>a>>b;
if (a>b)
max=a;
else
max=b;
cout<<"max="<<max<<endl;
return 0;
}
#include <iostream>
using namespace std;
int max ( int x,int y)
{
int z;
if (x>y) z=x;
else z=y;
return (z);
}
int main()
{
int a,b,m;
cin>>a>>b;
m=max(a,b);
cout<<"max="<<m<<endl;
return 0;
}