B2049 最大数输出 题解
Forever1507 · · 题解
求最大值可以使用 c++ 中自带的 max 函数解决。
使用格式: max(a1,a2) ,随后会返回 a1 和 a2 中较大的数,三个数的最大值嵌套一下即可。
Code:
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int main(){
cin>>a>>b>>c;
cout<<max(a,max(b,c));//取a与b,c最大值的最大值,也就是a,b,c的最大值
return 0;
}