?? indexofmax.cpp
字號:
// find location of maximum of n numbers
#include <iostream>
#include <algorithm> // has copy
#include "indexOfMax.h"
using namespace std;
int main()
{
int a[6] = {1, 4, 2, 5, 6, 3};
// output the array elements
cout << "a[0:5] = ";
copy(a, a+6, ostream_iterator<int>(cout, " "));
cout << endl;
// test the function indexOfMax
cout << "max(a,1) = " << a[indexOfMax(a,1)] << endl;
cout << "max(a,3) = " << a[indexOfMax(a,3)] << endl;
cout << "max(a,6) = " << a[indexOfMax(a,6)] << endl;
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -