tutorial2.cpp: In function ‘int main()’:
tutorial2.cpp:6:3: error: ‘cin’ is not a member of ‘std’
std::cin >> num;
^
tutorial2.cpp:9:4: error: ‘cin’ is not a member of ‘std’
std::cin >> arr[i];
^
tutorial2.cpp:9:16: error: ‘arr’ was not declared in this scope
std::cin >> arr[i];
^
tutorial2.cpp:11:3: error: ‘cout’ is not a member of ‘std’
std::cout<<GetMax(num, arr)<<std::endl;
^
tutorial2.cpp:11:26: error: ‘arr’ was not declared in this scope
std::cout<<GetMax(num, arr)<<std::endl;
^
tutorial2.cpp:11:29: error: ‘GetMax’ was not declared in this scope
std::cout<<GetMax(num, arr)<<std::endl;
^
tutorial2.cpp:11:32: error: ‘endl’ is not a member of ‘std’
std::cout<<GetMax(num, arr)<<std::endl;
^
tutorial2.cpp: In function ‘int GetMax(int, int*)’:
tutorial2.cpp:16:31: error: ‘max_element’ was not declared in this scope
return *max_element(a, a + n);
^
tutorial2.cpp:16:31: note: suggested alternative:
In file included from /usr/include/c++/4.9/algorithm:62:0,
from tutorial2.cpp:1:
/usr/include/c++/4.9/bits/stl_algo.h:5510:5: note: ‘std::max_element’
max_element(_ForwardIterator __first, _ForwardIterator __last,
^
tutorial2.cpp:18:2: warning: control reaches end of non-void function [-Wreturn-type]
}
^