日考19
parent
bd6c81f3f8
commit
605d62e882
|
@ -37,7 +37,7 @@ public class day19 {
|
||||||
|
|
||||||
// 使用stream流获取学生成绩
|
// 使用stream流获取学生成绩
|
||||||
HashMap<String,Double> hmap = new HashMap<>();
|
HashMap<String,Double> hmap = new HashMap<>();
|
||||||
students.stream().sorted().map(stu -> {
|
students.stream().forEach(stu -> {
|
||||||
int n = 0;
|
int n = 0;
|
||||||
for (String key : hmap.keySet()) {
|
for (String key : hmap.keySet()) {
|
||||||
if (stu.getName().equals(key)){
|
if (stu.getName().equals(key)){
|
||||||
|
@ -49,8 +49,6 @@ public class day19 {
|
||||||
}else{
|
}else{
|
||||||
hmap.put(stu.getName(),hmap.get(stu.getName())+stu.getScore());
|
hmap.put(stu.getName(),hmap.get(stu.getName())+stu.getScore());
|
||||||
}
|
}
|
||||||
|
|
||||||
return stu;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 输出学生成绩
|
// 输出学生成绩
|
||||||
|
|
Loading…
Reference in New Issue