4.1 函数 【C++】

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

#include "stdafx.h"
#include <iostream>
#include "stdafx.h"   
using namespace std;
//function name overloading 函数名重载  同个函数名,不同的参数个数和参数类型
// 名字装饰 name decoration
// int maximum(int x, int y); 
// float maximum(float x, float y);  // 声明declaration
// float maximum(float x, float y, float z); 
int maximum(int x, int y) {	
	return x >= y ? x : y;
}
int main(){
	int iMax = 0;
        iMax = maximum(3,77);	
	cout << "iMax:" << iMax << endl;
        return 0;
}
发布了41 篇原创文章 · 获赞 1 · 访问量 474

猜你喜欢

转载自blog.csdn.net/weixin_44773006/article/details/103507191