Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Conta valores acima da média
($sum, $result) = (0, 0); $listlen = <STDIN>; if (($listlen > 0) && ($listlen < 100)) { # Read input into an array and compute the sum for ($counter = 0; $counter < $listlen; $counter++) { $intlist[$counter] = <STDIN>; $sum = $sum + $intlist[$counter]; } #- end of for (counter ... # Compute the average $average = $sum / $listlen; # Count the input values that are > average foreach $num (@intlist) { if ($num > $average) { $result++; } } #- end of foreach $num ... # Print result print "Number of values > average is: $result \n"; } #- end of if (($listlen ... else { print "Error--input list length is not legal \n"; }
run
|
edit
|
history
|
help
0
Challenge 41 Task 1
Balancing brackets
Arrayop
101744
Sanjana 101742
Shalu Kumar
test hello world perl n texs
each_hash_function
perl plot circular list in a circle
grid