Find the numbers

Get the numbers from a string separated by a white space..

IN

"1 23 34 234"

OUT

1
23
34
234
Login to submit solution


10 symbols php failed test 1 Wrong answer
s/ /\n/g
instead of
1
23
34
234
Thu Feb 12 20:43:12 2015 danieljabailey
#!/usr/bin/php -p
s/ /\n/g
10 symbols perl failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Thu Feb 12 20:43:22 2015 danieljabailey
#!/usr/bin/perl -p
s/ /\n/g
37 symbols python2 failed test 1 Wrong answer
23
34
23
instead of
1
23
34
234
Thu Feb 12 23:16:32 2015 PFischbeck
print input()[1:-1].replace(" ","\n")
8 symbols perl failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Fri Feb 13 13:53:08 2015 vakorol
#!/usr/bin/perl -p
y/ /
/
27 symbols haskell failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Fri Mar 13 13:56:53 2015 YoshikuniJujo
main=interact$unlines.words
37 symbols python2 failed test 1 Wrong answer
23
34
23
instead of
1
23
34
234
Thu Feb 4 19:04:24 2016 felixbade
print'\n'.join(input()[1:-1].split())
8 symbols bash failed test 1 Wrong answer
"1n23n34n234"
instead of
1
23
34
234
Tue Feb 9 03:02:20 2016 t4g
tr \  \n
11 symbols bash failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Tue Feb 9 03:02:52 2016 t4g
tr ' ' '\n'
15 symbols ruby2.0 failed test 1 Wrong answer
"\"1 23 34 234\""
instead of
1
23
34
234
Tue Mar 22 02:54:59 2016 Jian Zhang
$<.each{|x|p x}
25 symbols ruby2.0 failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Tue Mar 22 02:56:56 2016 Jian Zhang
gets.split.map{|x|puts x}
30 symbols ruby2.0 failed test 1 Wrong answer
0
23
34
234
instead of
1
23
34
234
Tue Mar 22 03:00:20 2016 Jian Zhang
gets.split.map{|x|puts x.to_i}
25 symbols ruby2.0 failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Tue Mar 22 03:01:11 2016 Jian Zhang
gets.split.map{|x|puts x}
27 symbols ruby2.0 failed test 1 Wrong answer
0
23
34
234
instead of
1
23
34
234
Tue Mar 22 03:01:58 2016 Jian Zhang
gets.split.map{|x|p x.to_i}
31 symbols python3 failed test 1 Code error

Traceback (most recent call last): File "./code", line 1, in <module> print("\n".join(input.split())) AttributeError: 'builtin_function_or_method' object has no attribute 'split'

Sun Jul 10 17:13:41 2016 Katie Gardner
print("\n".join(input.split()))
33 symbols python3 failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Sun Jul 10 17:15:04 2016 Katie Gardner
print("\n".join(input().split()))
61 symbols ruby failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Tue Sep 20 12:05:20 2016 JJonesJr
inp = gets.chomp.split(" ");
for i in inp do
    puts i;
end
66 symbols ruby failed test 1 Wrong answer
0
23
34
234
instead of
1
23
34
234
Tue Sep 20 12:09:47 2016 JJonesJr
inp = gets.chomp.split(" ");
for i in inp do
    puts i.to_i;
end
55 symbols ruby failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Tue Sep 20 12:13:48 2016 JJonesJr
inp = gets.split(" ");
for i in inp do
    puts i;
end
46 symbols python3 failed test 1 Wrong answer
"1
23
34
234"
instead of
1
23
34
234
Sat Oct 8 14:39:24 2016 GreenJoey
data = input().split()

print(*data, sep="\n")

View all solutions