#include
#include
using namespace std;
float compare(float *a,float &b) //a为指针,b为引用
{
if (*a>b) return *a;
else return b;
}
int main()
{
float x,y;
cin>>x>>y;
cout<<"The max="<
}
#include
using namespace std;
float compare(float *a,float *b)
{
if (*a>*b) return *a;
else return *b;
}
float compare(float &a,float &b)
{
return (a>b?a:b);
}
int main()
{
float x,y;
cout<<"请输入两个参数:"<
cout<<"当形参为指针时:"<
}
#include
#include
dedecms.com
using namespace std;
float compare(float *a,float &b) //a为指针,b为引用
{
if (*a>b) return *a;
else return b;
}
int main()
{
float x,y;
cin>>x>>y;
cout<<"The max="<
}