mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
27 lines
374 B
Nim
27 lines
374 B
Nim
discard """
|
|
action: compile
|
|
"""
|
|
|
|
import strutils
|
|
|
|
var x = 343
|
|
|
|
case stdin.readline.parseInt
|
|
of 0:
|
|
echo "most common case"
|
|
of 1:
|
|
{.linearScanEnd.}
|
|
echo "second most common case"
|
|
of 2: echo "unlikely: use branch table"
|
|
else:
|
|
echo "unlikely too: use branch table"
|
|
|
|
|
|
case x
|
|
of 23: echo "23"
|
|
of 343: echo "343"
|
|
of 21: echo "21"
|
|
else:
|
|
{.linearScanEnd.}
|
|
echo "default"
|