Показать сообщение отдельно

  #7  
Старый 01.09.2008, 09:11
4p3
Участник форума
Регистрация: 18.08.2008
Сообщений: 159
Провел на форуме:
750247

Репутация: 92
По умолчанию

Юзайте #include <algorithm>

Изобретение велосипеда, это не true

Код:
// test.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include "stdafx.h"

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	const int nSize = 10;
	int nArray[nSize];

	for (int i = 0;i < nSize;++i)
		cin >> nArray[i];
	cout << *std::max_element(nArray, &nArray[10]) << endl;//дадада именно на 11 элемент. Это же итераторы
	system("pause");
	return 0;
}
 
Ответить с цитированием