Last active
October 20, 2016 03:30
-
-
Save nukosuke/369c514b4e18cbe4b20c657f788663f6 to your computer and use it in GitHub Desktop.
ワンライナーでスペース区切りで表現された数列を標準入力から1行を読み込んで整数値に変換する方法
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
"" |> IO.gets |> String.trim_trailing |> String.split(" ") |> Enum.map(&String.to_integer(&1)) |
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
var N = require('fs').readFileSync('/dev/stdin', 'utf8').split(' ').map(Number); |
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
local N = (function(n) for s in string.gmatch(io.read(), "[^%s]+") do table.insert(n, s) end return n end)({}) |
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
my @N = get().split(' ').map({.Int}); |
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
<?php $N = array_map('intval', explode(' ', trim(fgets(STDIN)))); |
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
my @N = map { $_ + 0 } split ' ', <>; |
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
N = map(lambda s:int(s), raw_input().split(' ')) |
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
N = gets.split.map(&:to_i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment