Skip to content

Instantly share code, notes, and snippets.

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