Здравствуйте!
Подскажите, почему валидатор может не принимать задачу?
package com.javarush.task.task19.task1919;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.TreeMap;
/*
Считаем зарплаты
*/
public class Solution {
public static void main(String[] args) throws IOException {
TreeMap <String, Double> map = new TreeMap<>();
FileReader stream = new FileReader(args [0]);
BufferedReader bufferedStream = new BufferedReader(stream);
while (bufferedStream.ready()) {
String str = bufferedStream.readLine();
String [] temporaryArray = str.split(" ");
String name = temporaryArray [0];
Double value = Double.valueOf(temporaryArray [1]);
if (map.containsKey(name)) {
map.replace(name, map.get(name), value + map.get(name));
} else {
map.put(name, value);
}
}
for (Object i : map.entrySet()){
System.out.println(i);
}
bufferedStream.close();
stream.close();
}
}