竞赛
考级
#include<iostream> using namespace std; void baron(int a,int b,int c){ int sum=a; if(sum<b){ sum=b; } if(sum<c){ sum=c; } cout<<sum; } int main(){ int a,b,c; cin>>a>>b>>c; baron(a,b,c); }
琮
暗影775(进团给身份)
欢迎加入团队:进步的蜗牛 欢迎在我的题单做题
i amthebest™搬至洛谷
188****0924
#include<iostream> using namespace std; void max(int a,int b,int c){ int maxx=a; if(b>maxx){ maxx=b; } if(c>maxx){ maxx=c; } cout<<maxx; } int main(){ int a,b,c; cin>>a>>b>>c; max(a,b,c); }
钓夫
cos
#include<iostream> using namespace std; int Max(int a,int b,int c){ int m=a; if(m<b){ m=b; } if(m<c){ m=c; } return m; } int main(){ int a,b,c; cin>>a>>b>>c; int m=Max(a,b,c); cout<<m; return 0; }
雷神的怒火
点个关注!
信奥--小潘 CPZT ACGO
比大小,可以用if判断也可以用max解决 if判断的代码如下: max函数解决就简单了,代码如下:
邱澤銳·龍龘龖🔥
#include<iostream> using namespace std; void a(int s,int d,int f){ if(s<d)s=d; if(s<f)s=f; cout<<s; } int main(){ int z,x,c; cin>>z>>x>>c; a(z,x,c); return 0; }
张*程
⨝
思路:先让a成为a,b中的较大数,然后用c比较a得出最大的
━━╋═══════════➢™
#include<iostream> #include<cmath> using namespace std; int a(int s,int d,int f){ if(s<d)s=d; if(s<f)s=f; return s; } int main(){ int z,x,c; cin>>z>>x>>c; cout<<a(z,x,c); return 0; }
#include<iostream> #include<cmath> using namespace std; int a(int s,int d,int f){ s=max(s,d); s=max(s,f); return s; } int main(){ int z,x,c; cin>>z>>x>>c; cout<<a(z,x,c); return 0; }
#include<iostream> #include<cmath> using namespace std; void a(int s,int d,int f){ s=max(s,d); s=max(s,f); cout<<s; } int main(){ int z,x,c; cin>>z>>x>>c; a(z,x,c); return 0; }
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c,x; cin>>a>>b>>c; x=max(max(a,b),c); cout<<x; }
庞文昊
yy
#include <bits/stdc++.h> using namespace std; void max_out(int a,int b,int c){ cout<<max(a,max(b,c)); return ; } int main(){ int a,b,c; cin>>a>>b>>c; max_out(a,b,c); }
上个世纪穿越回来的我的世界老玩家
#include<bits/stdc++.h> using namespace std; int s(int a,int b,int c){ if(a>b&&a>c){ return a; } else if(b>a&&b>c){ return b; } else{ return c; } } int main(){ int a,b,c; cin>>a>>b>>c; cout<<s(a,b,c); return 0; }
~
共39条