prog10_03.cpp
来自「一本语言类编程书籍」· C++ 代码 · 共 20 行
CPP
20 行
// Program 10.3 Using functions in a namespace File prog10_03.cpp
#include <iostream>
#include "compare.h"
using compare::max; // Using declaration for max
using compare::min; // Using declaration for min
using std::cout;
using std::endl;
int main() {
double data[] = {1.5, 4.6, 3.1, 1.1, 3.8, 2.1};
const int dataSize = sizeof data/sizeof data[0];
cout << endl;
cout << "Minimum double is " << min(data, dataSize) << endl;
cout << "Maximum double is " << max(data, dataSize) << endl;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?