#include<iostream>
using namespace std;
int main(){
int max(int a,int b ,int c,int d);
int x,y,z,w,t;
cout<<"please input numbers:";
cin>>x>>y>>z>>w;
t=max(x,y,z,w);
cout<<"最大值为:"<<t<<endl;
return 0;
}
int max(int a,int b,int c ,int d){
int max(int x,int y);
int temp;
temp=max(a,b);
temp=max(temp,c);
temp=max(temp,d);
return temp;
}
int max(int x,int y){
if(x>y){
return x;
}
else{
return y;
}
}
通过函数实现几个数中最大的一个
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:如何自动生成测试报告?
下一篇:通过函数实现三个数从大到小的排序
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
获取一组对象某字段的最大值
【代码】获取一组对象某字段的最大值。
java API