#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int tab[] = {1,2,3,4,3,2,1};
auto max = std::max_element(tab, tab+7);
std::cout << *max << std::endl
<< "pos: " << std::distance(tab,max) << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgdGFiW10gPSB7MSwyLDMsNCwzLDIsMX07CglhdXRvIG1heCA9IHN0ZDo6bWF4X2VsZW1lbnQodGFiLCB0YWIrNyk7CglzdGQ6OmNvdXQgPDwgKm1heCA8PCBzdGQ6OmVuZGwKCQkJICA8PCAicG9zOiAiIDw8IHN0ZDo6ZGlzdGFuY2UodGFiLG1heCkgPDwgc3RkOjplbmRsOwoJcmV0dXJuIDA7Cn0=