#include
using namespace std;
void print_hello(){
cout<<“hello world!”<<endl;
}
//函数可以拥有同样的函数名,参数列表不同,参数的个数不同或者参数的类型不同
//如果两个函数有同样的函数名和参数列表,但是返回值不同,不是函数重载
//重复是指两个函数的本质是相同的,编译器调用时会出现二异性问题
void bigger(int a,int b){
//if(a>b)
//{
// cout<<“bigger is”<<a<<endl;
// }else{
// cout<<“bigger is”<<b<<endl;
// }
cout<<“bigger is :”<<(a>b?a:b)<<endl;
}
void bigger(char a,char b,char c){
cout<<“bigger is :”<<(a>b?a:b)<<endl;
}
void bigger(double a,double b){
cout<<“bigger is :”<<(a>b?a:b)<<endl;
}
int main(int argc, char const *argv[])
{
bigger(3.14,2.79);
bigger(100,99);
print_hello();
return 0;
}