📜  在数组 c++ 代码示例中找到最大值

📅  最后修改于: 2022-03-11 14:44:57.334000             🧑  作者: Mango

代码示例5
int main(int argc, char** argv) {
  int A[4] = {0, 2, 3, 1};
  const int N = sizeof(A) / sizeof(int);

  cout << "Index of max element: "
       << distance(A, max_element(A, A + N))
       << endl;

  return 0;
}