Last active
October 11, 2017 15:48
-
-
Save Yardanico/851a97914bb196f85affe69e5b0eb153 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import macros, strutils | |
template readLn(args: varargs[typed]): untyped = | |
let data = stdin.readLine().split() | |
var i = 0 | |
while i < args.len: | |
let value = data[i] | |
when arg is int: | |
arg = parseInt(value) | |
elif arg is float: | |
arg = parseFloat(value) | |
elif arg is string: | |
arg = value | |
elif arg is bool: | |
arg = parseBool(value) | |
inc i | |
var | |
a, b, c: int | |
d: bool | |
readLn(a, b, c, d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment