What's wrong?
package com.codegym.task.task08.task0823;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.ArrayIndexOutOfBoundsException;
/*
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();
String[] a = s.split("\\s+");
for (int i = 0 ; i < a.length; i++){
char[] b = a[i].toCharArray();
b[0] = Character.toUpperCase(b[0]);
for (int j = 0 ; j < b.length; j++){
System.out.print(b[j]);
}
System.out.print(" ");
}
//write your code here
}
}