Created
June 1, 2023 15:52
-
-
Save tech-andgar/08e8480daaf8ea6938fa76213ae9b923 to your computer and use it in GitHub Desktop.
WeinFlu Result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
var ages = [33, 15, 27, 40, 22, 19, 32, 76, 45]; | |
ages.sort(); | |
print('La edad mayor es: ${ages.last}'); | |
print('La edad menor es: ${ages.first}'); | |
print('La edad promedio es: ${ageAvg(ages)}'); | |
} | |
double ageAvg(List<int> ages) => | |
(ages.reduce((value, element) => value + element)) / ages.length; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment