В чем проблема?
package com.javarush.task.task18.task1817;
/*
Пробелы
*/
import java.io.FileInputStream;
public class Solution {
public static void main(String[] args) throws Exception{
int allSymbol = 0;
int probel = 0;
FileInputStream fileInputStream = null;
if(args.length > 0){
fileInputStream = new FileInputStream(args[0]);
}
while (fileInputStream.available() > 0){
int a= fileInputStream.read();
if(a == 32){
probel++;
allSymbol++;
}else {
allSymbol++;
}
}
fileInputStream.close();
double res =(double) (probel/allSymbol*100);
System.out.println(String.format("%.2f", res));
}
}