Largest five adjacent number: Difference between revisions

no edit summary
(Added Go)
No edit summary
Line 5:
<br> Find the '''five''' adjacent digits in the 1000-digit number that form the largest 5-digit number.
<br>
;Extra credi
 
<br>
Find the '''five''' adjacent digits in the 1000-digit number that form the smallest 5-digit number.
 
 
Line 266 ⟶ 268:
digit = ""
max = 0
min = 99999
limit = 1000
 
Line 279 ⟶ 282:
if resNum > max
max = resNum
ok
if resNum < min
min = res
ok
next
Line 284 ⟶ 290:
see "The largest number is:" + nl
see max + nl
see "The smallest number is:" + nl
see min + nl
</lang>
{{out}}
Line 289 ⟶ 297:
The largest number is:
99638
The smallest number is:
00118
</pre>
 
2,468

edits