RYIP在线题库
首 页   >   习题练习   >   提交
Problem1579--Unix-tail

1579: Unix-tail

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

【 Description 】

Unix里有个工具叫tail,他默认显示文件或输入信息的最后10行。
还可以跟一个参数,用减号-标记,表示指定最后n行。

tail -100
显示最后100行
tail则显示最后10行
如果这个文件或输入不够指定的行数,则全部输出。

【 Input 】

头一行是命令,可以省略参数,等价于-10。剩下的是输入

【 Output 】

根据命令完成tail功能,输出输入的最后n行

【 Sample Input 】

tail -2
abc
def
ghi
jkl

【 Sample Output 】

ghi
jkl

【 Source/Category 】