输出结果有四个不说,还一个都不对
#include<iostream>
#include<math.h>
using namespace std;
int max(int a,int b) {
if (a>=b)
return a;
else if (a<b)
return b;
}
int max(int a,int b,int c){
int d;{
if(a>=b)
d=a;
else if(a<b)
d=b;}
if(d>=c)
return d;
else if(d<c)
return c;
}
double max(double a,double b){
if (fabs(a-b)>=0.00001)
return a;
else if (fabs(a-b)<0.00001)
return b;
}
double max(double a,double b,double c){
double d;{
if(fabs(a-b)>=0.00001)
d=a;
else if(fabs(a-b)<0.00001)
d=b;}
if(fabs(d-c)>=0.00001)
return d;
else if(fabs(d-c)<0.00001)
return c;
}
int main(){
int m,n;
cin>>m>>n;
cout<<"the max is "<<max(m,n)<<endl;
int e,r,t;
cin>>e>>r>>t;
cout<<"the max is "<<max(e,r,t)<<endl;
double y,u;
cin>>y>>u;
cout<<"the max is "<<max(y,u)<<endl;
double i,o,p;
cin>>i>>o>>p;
cout<<"the max is "<<max(i,o,p)<<endl;
return 0;
}