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;
}

posted @ 2017-09-05 09:24  Advancing-Swift  阅读(227)  评论(0编辑  收藏  举报