We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
while(std::cin>>n){// for each candle n check:if(max<n){// does n set a new record in height?max=n;// if that's so, then n is the new max heightc=1;// and the counter c must be set to 1 again. "!!" is a cheap trick to convert any value different from 0 into 1}else{// otherwise check if the new candle is as tall as maxif(max==n)c++;// in that case, add 1 to counter (otherwise add 0)}}
Birthday Cake Candles
You are viewing a single comment's thread. Return to all comments →
can be translated as: