I'll walk you through finding the largest element in a vector. You initialize int maxVal = v[0] to store the first element as the current maximum. Then loop through the rest with for(int i = 1; i < v.size(); i++).
Inside the loop, check if(v[i] > maxVal) and update maxVal = v[i] when you find a bigger value. After the loop, maxVal holds the largest element. This breaks on empty vectors, so check v.empty() first.
Alternatively, use *max_element(v.begin(), v.end()) from the algorithm library which returns the maximum in one line.