fork download
  1. void printTopStudents(Map<String, int> studentScores) {
  2. for (var entry in studentScores.entries) {
  3. if (entry.value > 80) {
  4. print(entry.key);
  5. }
  6. }
  7. }
  8.  
  9. void main() {
  10. Map<String, int> students = {
  11. 'Alice': 85,
  12. 'Bob': 78,
  13. 'Charlie': 92,
  14. 'Diana': 88,
  15. 'Ethan': 76,
  16. 'Fiona': 95,
  17. 'George': 81,
  18. 'Hannah': 67,
  19. 'Ian': 83,
  20. 'Julia': 79,
  21. };
  22.  
  23. printTopStudents(students);
  24. }
  25.  
Success #stdin #stdout 1.65s 129592KB
stdin
Standard input is empty
stdout
Alice
Charlie
Diana
Fiona
George
Ian