Reverse

Reverse a given number, and output it.

IN

12345

OUT

54321

IN

120

OUT

21

IN

10000

OUT

1

IN

4837

OUT

7384
Login to submit solution


20 symbols python3 failed test 2 Wrong answer
021
instead of
21
Fri Mar 21 20:18:04 2014 plain_alex
print(input()[::-1])
27 symbols python3 failed test 2 Wrong answer
021
instead of
21
Fri Mar 21 20:19:26 2014 plain_alex
print(input()[::-1],end='')
26 symbols perl failed test 1 Wrong answer
54321
instead of
54321
Thu Mar 27 13:32:00 2014 bugov
#!/usr/bin/perl -pl0
$_=int reverse split//
35 symbols perl failed test 2 Wrong answer
021
instead of
21
Sat Mar 29 06:36:51 2014 karjala
print join '', reverse split //, <>
36 symbols perl failed test 1 Wrong answer

                      
instead of
54321
Sat Mar 29 06:39:18 2014 karjala
$_ = join('', reverse split //, $_);
20 symbols perl failed test 2 Wrong answer
021
instead of
21
Sat Mar 29 07:20:39 2014 karjala
print "".reverse(<>)
47 symbols haskell failed test 2 Wrong answer
021
instead of
21
Tue Apr 1 07:14:59 2014 rippy
main = do
  s <- getLine
  putStrLn $ reverse s
23 symbols ruby2.0 failed test 1 Wrong answer

                      
instead of
54321
Tue Apr 1 20:40:37 2014 olistik
gets.chomp.reverse.to_i
27 symbols perl failed test 1 Wrong answer

                      
instead of
54321
Fri Apr 4 06:26:08 2014 karjala
$_ = "".reverse(scalar(<>))
23 symbols perl failed test 1 Wrong answer

                      
instead of
54321
Fri Apr 4 06:27:11 2014 karjala
$_ = "".reverse("".<>);
38 symbols perl failed test 1 Wrong answer

                      
instead of
54321
Fri Apr 4 06:29:32 2014 karjala
my $s = <>; chomp $s; $_ = reverse $s;
48 symbols perl failed test 2 Wrong answer
021
instead of
21
Fri Apr 4 06:32:39 2014 karjala
my $s = <>; chomp $s; $s = reverse $s; print $s;
36 symbols python2 failed test 1 Code error

File "./code", line 1 print(int(raw_input()[::-1]),end='') ^ SyntaxError: invalid syntax

Mon Apr 7 12:04:35 2014 Isa Ac
print(int(raw_input()[::-1]),end='')
42 symbols haskell failed test 1 Code error

code:1:26: Couldn't match type ‘[]’ with ‘IO’ Expected type: a0 -> IO Char Actual type: a0 -> String In the first argument of ‘mapM_’, namely ‘show’ In the first argument of ‘(.)’, namely ‘mapM_ show’

Mon May 26 18:30:58 2014 ledyba
main=getContents>>=mapM_ show.read.reverse
16 symbols bash failed test 3 Wrong answer
0001
instead of
1
Mon Jun 16 12:54:31 2014 avkhozov
rev|sed 's/^0//'
26 symbols python2 failed test 2 Wrong answer
021
instead of
21
Mon Aug 4 18:07:55 2014 LLcoolNJ
print str(input())[-1::-1]
24 symbols python2 failed test 2 Wrong answer
021
instead of
21
Mon Aug 4 18:09:49 2014 LLcoolNJ
print str(input())[::-1]
21 symbols perl failed test 1 Code error

Undefined subroutine &main::input called at ./code line 1.

Tue Sep 29 01:51:51 2015 Virsalus
echo strrev(input());
21 symbols php failed test 1 Wrong answer
echo strrev(input());
instead of
54321
Tue Sep 29 01:52:34 2015 Virsalus
echo strrev(input());
27 symbols php failed test 1 Code error

PHP Fatal error: Call to undefined function input() in /opt/share/code on line 1

Tue Sep 29 01:53:38 2015 Virsalus
<?php echo strrev(input());

View all solutions