master
面包骑士 2024-08-08 09:28:45 +08:00
parent bd6c81f3f8
commit 605d62e882
1 changed files with 1 additions and 3 deletions

View File

@ -37,7 +37,7 @@ public class day19 {
// 使用stream流获取学生成绩
HashMap<String,Double> hmap = new HashMap<>();
students.stream().sorted().map(stu -> {
students.stream().forEach(stu -> {
int n = 0;
for (String key : hmap.keySet()) {
if (stu.getName().equals(key)){
@ -49,8 +49,6 @@ public class day19 {
}else{
hmap.put(stu.getName(),hmap.get(stu.getName())+stu.getScore());
}
return stu;
});
// 输出学生成绩