- #!/usr/bin/perl
- use strict;
- use warnings;
-
- my @num;
- push @num,split while(<DATA>);
- for my $z(0..9) {
- print "$z ";
- for (@num) {
- print "$_ " if /$z$/;
- }
- print "\n";
- }
- __DATA__
- 530 862 477 448
- 407 68 191 157 929
- 76 866 730 445 665
- 591 99 285 868
- 352 64 196 755 220
- 922 245 966 294 118
- 839 757 564 701 391
- 629 794 33 253
- 110 349 604 962 868
- 846 20 637 11 782
- 233 10 23 593 51
复制代码
|