繁体   English   中英

编写一个程序,从标准输入读取行,按第三个单词按字典顺序对它们进行排序,并将它们打印到标准 output [关闭]

[英]Write a program that reads lines from standard input, sorts them lexicographically by the third word, and prints them to standard output [closed]

请求包含字符串。 您需要按第三个单词对行进行排序。

样本输入:

Perl can bend steel bars and move mountains.
Perl can turn back the hands of time. 
Perl is good for the goose and for the gander. 
Perl can beat up Mike Tyson with one hand tied behind its back. 
Perl can make a rock so heavy it can't lift it.

样品 Output:

Perl can beat up Mike Tyson with one hand tied behind its back.
Perl can bend steel bars and move mountains. 
Perl is good for the goose and for the gander. 
Perl can make a rock so heavy it can't lift it.
Perl can turn back the hands of time.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM