Skip to content

Instantly share code, notes, and snippets.

@tomcha
Last active December 4, 2015 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomcha/284107ef182a60cf77ac to your computer and use it in GitHub Desktop.
Save tomcha/284107ef182a60cf77ac to your computer and use it in GitHub Desktop.
43
#!/usr/bin/env perl
use strict;
use warnings;
use DDP{deparse => 1 };
my @num;
@num = (1..1000);
my @rev_num = reverse @num;
# 文字順でソートの時
my @sort_num = sort @rev_num;
# 数値順でソートの時
my @sort_num = sort{$a <=> $b }@rev_num;
# 以降の問に使用するのは、"数値順でソート"を利用して下さい。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment