Commit 5ab198b6 by Patryk Czarnik

kalk 1-metodowy 1

parent 2aa2c84e
......@@ -14,10 +14,8 @@ public class P3_Grupowanie {
for (Employee emp : emps) {
final String city = emp.getCity();
if (cnt.containsKey(city)) {
Integer oldCnt = cnt.get(city);
cnt.put(city, oldCnt+1);
Integer oldSum = sum.get(city);
sum.put(city, oldSum+emp.getSalary());
cnt.put(city, cnt.get(city) +1);
sum.put(city, sum.get(city) +emp.getSalary());
} else {
cnt.put(city, 1);
sum.put(city, emp.getSalary());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment