A+B: Difference between revisions

Content added Content deleted
Line 2,683: Line 2,683:
<lang Perl>my ($a,$b) = split(' ', scalar(<STDIN>));
<lang Perl>my ($a,$b) = split(' ', scalar(<STDIN>));
print "$a $b " . ($a + $b) . "\n";</lang>
print "$a $b " . ($a + $b) . "\n";</lang>

# Or using The List::Util module and a modern perl...
# Or using The List::Util module and a modern perl...
say sum split /\s+/, scalar <STDIN>;
say sum split /\s+/, scalar <STDIN>;