Could anyone help me?
package pl.codegym.task.task18.task1817;
/*
Spacje
*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.DecimalFormat;
public class Solution {
public static void main(String[] args) throws IOException {
String fileName = "C:\\Users\\pawel\\Desktop\\plik1.txt";
FileInputStream fileInputStream = new FileInputStream(fileName);
int n1 = fileInputStream.available();
int n2 = 0;
while(fileInputStream.available()>0){
if(fileInputStream.read() == 32)
n2++;
}
double i = (double)n2/(double)n1*100;
System.out.printf("%.2f",i);
fileInputStream.close();
}
}