Greatest element of a list: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
Line 4,553: Line 4,553:
Greatest element is 5992424433449</pre>
Greatest element is 5992424433449</pre>


=={{header|Vlang}}==
=={{header|V (Vlang)}}==
<syntaxhighlight lang="vlang">fn max<T>(list []T) T {
<syntaxhighlight lang="v (vlang)">fn max<T>(list []T) T {
mut max := list[0]
mut max := list[0]
for i in 1..list.len {
for i in 1..list.len {