I have a vector of colors, its elements are "red", "blue", "black" ...
how can I find which element has the longest name ?
I been playing with this for fwe hours and still can't figure this out.
I have a vector of colors, its elements are "red", "blue", "black" ...
how can I find which element has the longest name ?
I been playing with this for fwe hours and still can't figure this out.
How about this to start off with?
Code:T max = a[0]; for ( i = 1; i < n; i++ ) { if ( a[i] > max ) max = a[i]; }
My best code is written with the delete key.