Tac

Return lines in reverse order.

IN

qwer
asdf
zxcv

OUT

zxcv
asdf
qwer

IN

11

OUT

11

IN

!@#$
%^&*

OUT

%^&*
!@#$
Login to submit solution


4 symbols pyth
Mon Sep 19 13:16:16 2016 Sait2000
j_.z
9 symbols pyth
Mon Sep 19 13:13:43 2016 Sait2000
# aYw)j_Y
11 symbols bash
Tue Jul 26 10:43:30 2016 hidefromkgb
sed a\\|tac
12 symbols bash
Sun Jul 24 11:51:31 2016 hidefromkgb
sed 'a\'|tac
13 symbols bash
Wed Aug 13 01:21:54 2014 PFischbeck
sed '$a\'|tac
18 symbols ruby2.0
Sat Jul 5 12:47:31 2014 Nakilon
puts [*$<].reverse
24 symbols perl
Sat Jan 11 11:47:05 2014 bugov
#!/usr/bin/perl -p0a
$_=join'
',reverse@F
25 symbols perl
Sat Jan 11 11:42:25 2014 bugov
#!/usr/bin/perl -p0a
$_=join"\n",reverse@F
26 symbols ruby2.0
Sun Oct 5 20:06:52 2014 fl00r
puts $<.lines.to_a.reverse
28 symbols perl
Sun Jun 22 10:46:11 2014 avkhozov
#!/usr/bin/perl -ln
unshift@r,$_}{print for@r
35 symbols haskell
Fri Mar 13 09:59:29 2015 YoshikuniJujo
main=interact$unlines.reverse.lines
35 symbols haskell
Wed Apr 15 19:57:39 2015 Atte
main=interact$unlines.reverse.lines
47 symbols haskell
Mon May 26 15:20:11 2014 f4_alt
main=getContents>>=mapM_ putStrLn.reverse.lines
53 symbols python2
Mon Aug 11 12:25:33 2014 xsot
import os
print'\n'.join(os.read(0,99).split()[::-1])
54 symbols python2
Mon Aug 11 12:23:55 2014 xsot
import os
for l in os.read(0,99).split()[::-1]:print l
63 symbols python2
Fri Aug 8 04:27:19 2014 PFischbeck
import sys
print"\n".join([s.strip() for s in sys.stdin][::-1])
64 symbols python3
Wed Apr 15 20:13:43 2015 Atte
import sys
print("\n".join([s.strip()for s in sys.stdin][::-1]))
72 symbols php
Wed Apr 15 20:33:35 2015 Atte
<?php
echo join('
',array_reverse(array_map(trim,file('php://stdin'))));
74 symbols haskell
Mon May 26 14:59:49 2014 ledyba
main=getContents>>=(\x->sequence$fmap putStrLn$reverse$lines x)>>return ()
76 symbols python2
Wed Jul 30 21:43:55 2014 vik
import sys
l=[s.strip() for s in sys.stdin]
print '\n'.join(l[::-1]).strip()

View all solutions