Что я не так делаю?
package com.javarush.task.task18.task1817;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.DecimalFormat;
/*
Пробелы
*/
public class Solution {
public static void main(String[] args) {
FileReader fileReader = null;
try{
fileReader = new FileReader(args[0]);
} catch (FileNotFoundException e){
e.printStackTrace();
}
long space = 0;
long symbols = 0;
try{
while (fileReader.ready()){
char charSymbolsFromFile = Character.toLowerCase((char) fileReader.read());
if (charSymbolsFromFile == ' '){
space++;
} else {
symbols++;
}
}
double result = Math.round(symbols/space*100);
System.out.println(result);
} catch (IOException e){
e.printStackTrace();
}
try{
fileReader.close();
} catch (IOException e){
e.printStackTrace();
}
}
}