Thread Notendurchschnitt-Berechner
(20 answers)
Opened by The_Marv at 2010-10-29 15:06
als Anregung:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/usr/bin/perl use strict; use warnings; my @n; while(<STDIN>) { chomp; $_ or last; /^\d+(\.\d+)?/ or die("NO Number"); push(@n,$_+0); } my $s=0; map{$s+=$_}@n; $s/=@n; print "Durchschitt: $s\n"; |