It doesn't work, but I don't know why
package com.codegym.task.task08.task0823;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
/*
Going national
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
//write your code here
char[] c = s.toCharArray();
boolean space = true;
for(int i = 0; i < c.length; i++) {
if (space) {
c[i] = Character.toUpperCase(c[i]);
space = false;
}
else if (Character.isWhitespace(c[i])) {
space = true;
}
}
Arrays.toString(c);
}
}