- use Encode;
- use File::Slurp;
- STDOUT->autoflush(1);
-
- my @lines = read_file("src.txt");
- my $head = shift @lines;
-
- my @mat = map { s/\r?\n$//; [split " ", $_]; } @lines;
-
- @mat = sort {
- $a->[0] <=> $b->[0] ||
- $b->[1] <=> $a->[1] ||
- $a->[2] <=> $b->[2] ||
- $b->[3] <=> $a->[3] ||
- $a->[4] <=> $b->[4]
- } @mat;
-
- grep { printf "%s\n", join(",", @$_); } @mat;
复制代码
- 62,75,65,71,63
- 64,70,74,75,72
- 66,63,77,75,79
- 71,63,79,60,70
- 74,75,72,61,61
- 74,64,74,78,69
- 79,77,70,77,67
- 79,76,62,62,77
- 79,64,72,62,76
复制代码 不知道理解的对不对,升降升降升,分级排序。 |