c++ question 003 求两数大者?

#include <iostream>
using namespace std;

int main(){
//求两数中的大者?
int a,b;
cin>>a>>b;
if(a>b)
cout<<"The max number is:"<<a;
else
cout<<"The max number is:"<<b;
}

method two:

#include <iostream>
using namespace std;

int main(){
//求两数中的大者?
int a,b,max;
cin>>a>>b;
if(a>b)
max=a;
else
max=b;
cout<<"The max number is:"<<max;
}

原文地址:https://www.cnblogs.com/qingyundian/p/7476929.html