📄 overload.cpp
字号:
// overload.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
float max(float x,float y);
int max(int x,int y);
char max(char x,char y);
void main()
{
cout<<"最大的实数为:"<<max(3.6f,5.0f)<<endl;
cout<<"最大的整数为:"<<max(21,78)<<endl;
cout<<"最大的字符为:"<<max('A','B')<<endl;
}
float max(float x,float y)
{
return x>y?x:y;
}
int max(int x,int y)
{
return x>y?x:y;
}
char max(char x,char y)
{
return x>y?x:y;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -