Skip to content

Instantly share code, notes, and snippets.

@tomcha
Created November 7, 2014 11:49
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/46d8addb4b5285b0bd3d to your computer and use it in GitHub Desktop.
Save tomcha/46d8addb4b5285b0bd3d to your computer and use it in GitHub Desktop.
Perl入学式 標準入力の練習問題解答例
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
print "1つ目の数字を入力して下さい >>";
my $i = <STDIN>;
chomp $i;
print "2つ目の数字を入力して下さい >>";
my $j = <STDIN>;
chomp $j;
print "$i + $j = ".($i + $j)." \n";
print "$i - $j = ".($i - $j)." \n";
print "$i * $j = ".($i * $j)." \n";
print "$i / $j = ".($i / $j)." \n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment