Skip to content

Instantly share code, notes, and snippets.

@omas
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save omas/e3c6f0f07cee32796ad7 to your computer and use it in GitHub Desktop.

Select an option

Save omas/e3c6f0f07cee32796ad7 to your computer and use it in GitHub Desktop.
perl を思い出してみる
#! /usr/bin/perl
use strict;
use warnings;
my ($length,@stocks) = (<STDIN>,<STDIN>);
print(&sum(@stocks[0..$length -1]));
sub sum {
my $sum = 0;
$sum += $_ for @_;
return $sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment