c++编写
#include
using namespace std;
int Max1(int a,int b){
if(a>b)
return a;
else
return b;
}
double Max1(double x,double y){
if(x>y)
return x;
else
return y;
}
int Max1(int a,int b,int c){
return Max1(a,Max1(b,c));
}
double Max1(double x,double y,double z){
return Max1(x,Max1(y,z));
}
int main(){
int a,b,c;
cout<<"please enter two integer:";
cin>>a>>b;
cout<<"there is the answer:"< cout<<"please enter three integer:"; cin>>a>>b>>c; cout<<"there is the answer:"< double x,y,z; cout<<"please enter two numder:"; cin>>x>>y; cout<<"there is the answer:"< cout<<"please enter three number:"; cin>>x>>y>>z; cout<<"there is the answer:"< return 0; }
int max(int a,int b){ if(ab) return a; else return a;} int max(int a,int b,int c){ int max; if(a
#include
using namespace std;
int Max1(int a,int b){
if(a>b)
return a;
else
return b;
}
double Max1(double x,double y){
if(x>y)
return x;
else
return y;
}
int Max1(int a,int b,int c){
return Max1(a,Max1(b,c));
}
double Max1(double x,double y,double z){
return Max1(x,Max1(y,z));
}
int main(){
int a,b,c;
cout<<"please enter two integer:";
cin>>a>>b;
cout<<"there is the answer:"<
cout<<"please enter three integer:";
cin>>a>>b>>c;
cout<<"there is the answer:"<
double x,y,z;
cout<<"please enter two numder:";
cin>>x>>y;
cout<<"there is the answer:"<
cout<<"please enter three number:";
cin>>x>>y>>z;
cout<<"there is the answer:"<
return 0;
}
int max(int a , int b );int max(int a , int b , int c);int max(double a,double b);int max(double a,double b,double c);这样就可以了。
这个书上都有写的吧。。。