Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tomcha
Created December 19, 2015 04:23
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/22df3a332c2b8c996f42 to your computer and use it in GitHub Desktop.
Save tomcha/22df3a332c2b8c996f42 to your computer and use it in GitHub Desktop.
ouyou2
#!/usr/bin/env perl
use strict;
use warnings;
my @numbers;
print "5つの数字を入力して下さい。\n";
for my $i (1..5){
print "$iつ目の数字>>>";
my $num = <STDIN>;
chomp $num;
push @numbers, $num;
}
my @sorted_num = sort @numbers;
print "昇順に並べ替えた数字を出力します。\n";
for my $j (@sorted_num){
print "$j\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment