//函数重载
#include "iostream.h"
int test( int a,int b );
float test( float a,float b );
void main()
{
cout<<"调用test(1,2)的值为:"<<test(1,2)<<"/n";
cout<<"调用test(2.1f,3.14f)的值为:"<<test(2.1f,3.14f)<<"/n";
}
int test( int a,int b )
{
return (a+b);
}
float test( float a,float b )
{
return (a-b);
}
#include "iostream.h"
int test( int a,int b );
float test( float a,float b );
void main()
{
cout<<"调用test(1,2)的值为:"<<test(1,2)<<"/n";
cout<<"调用test(2.1f,3.14f)的值为:"<<test(2.1f,3.14f)<<"/n";
}
int test( int a,int b )
{
return (a+b);
}
float test( float a,float b )
{
return (a-b);
}
函数重载
最新推荐文章于 2023-07-29 18:07:52 发布