Birthday Cake Candles

Colleen is turning years old! She has candles of various heights on her cake, and candle has height . Because the taller candles tower over the shorter ones, Colleen can only blow out the tallest candles.

Given the for each individual candle, find and print the number of candles she can successfully blow out.

**Input Format**

The first line contains a single integer, , denoting the number of candles on the cake.

The second line contains space-separated integers, where each integer describes the height of candle .

**Output Format**

Print the number of candles Colleen blows out on a new line.

**Sample Input 0**

4

3 2 1 3

**Sample Output**

2

using namespace std; int main() { cin.ignore(); // skip past first line int current = 0; int count = 0; int max = 0; while( cin >> current ) { if( current > max ) { count = 1; max = current; } else if( current == max ) { count++; } } cout << count; return 0; }

## Leave a Reply