#include <iostream>
#include <algorithm>
void G(int* beg, int* end)
{
int* p = std::max_element(beg, end);
std::cout << "great element " << *p << " great index " << p-beg << '\n';
}
int main()
{
int a[]={4,5,2,12,67,9,0,13};
// G(std::begin(a), std::end(a));
G(a, a+sizeof a/sizeof *a); // ideone's compiler getting old
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp2b2lkIEcoaW50KiBiZWcsIGludCogZW5kKQp7CiAgICBpbnQqIHAgPSBzdGQ6Om1heF9lbGVtZW50KGJlZywgZW5kKTsKICAgIHN0ZDo6Y291dCA8PCAiZ3JlYXQgZWxlbWVudCAiIDw8ICpwIDw8ICIgZ3JlYXQgaW5kZXggIiA8PCBwLWJlZyA8PCAnXG4nOwp9CmludCBtYWluKCkKewogICAgaW50IGFbXT17NCw1LDIsMTIsNjcsOSwwLDEzfTsKICAgIC8vIEcoc3RkOjpiZWdpbihhKSwgc3RkOjplbmQoYSkpOwogICAgRyhhLCBhK3NpemVvZiBhL3NpemVvZiAqYSk7IC8vIGlkZW9uZSdzIGNvbXBpbGVyIGdldHRpbmcgb2xkCn0K