var ints []int
s := bufio.NewScanner(os.Stdin)
s.Split(bufio.ScanWords)
for s.Scan() {
i, err := strconv.Atoi(s.Text())
if err == nil {
ints = append(ints, i)
}
}
read <$> getLine :: IO [Integer]
-- reading space separated list of ints
map read . words <$> getLine :: IO [Int]
process.stdin.on('data', processLine)
function processLine (line) {
const string = line + ''
console.log(string)
}
(read)
fgl
type
TFloatList = specialize TFPGList<Double>;
var
List: TFloatList;
D: Double;
begin
List := TFloatList.Create;
while not Eof do
begin
Read(D);
List.Add(D);
end;
List.Free;
end.
var ints []int
s := bufio.NewScanner(os.Stdin)
s.Split(bufio.ScanWords)
for s.Scan() {
i, err := strconv.Atoi(s.Text())
if err == nil {
ints = append(ints, i)
}
}
type
TFloatList = specialize TFPGList<Double>;
var
List: TFloatList;
D: Double;
begin
List := TFloatList.Create;
while not Eof do
begin
Read(D);
List.Add(D);
end;
List.Free;
end.