3,4 условие ругается
package com.javarush.task.task18.task1817;
import java.io.FileReader;
import java.io.IOException;
import java.io.BufferedReader;
/*
Пробелы
*/
public class Solution {
public static void main(String[] args)throws IOException {
int sum = 0;
int sumsp = 0;
BufferedReader reader = new BufferedReader(new FileReader(args[0]));
while(reader.ready()) {
String line = reader.readLine();
String line2 = line.replaceAll("\\s", "");
String line3 = line.replaceAll("^\\s", "");
int n = line2.length();
int s = line3.length();
sum = sum + n;
sumsp = sumsp + s;
}
reader.close();
double value =(double)(sumsp/sum)*100;
System.out.print(String.format("%.2f",value));
}
}