其他分享
首页 > 其他分享> > 通过函数实现几个数中最大的一个

通过函数实现几个数中最大的一个

作者:互联网

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

标签:std,return,函数,temp,几个,max,cout,int,数中
来源: https://www.cnblogs.com/hongyixiaojiang/p/15377633.html