import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { int[] cal = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int[] days = new int[40]; for (int i = 0; i <= 3; i++) { for (int j = 0; j <= 9; j++) { days[i * 10 + j] = i + j; } } System.out.println(Arrays.toString(days)); int counter = 0; for (int i = 1; i <= 12; i++) { for (int j = 1; j <= cal[i - 1]; j++) { if (i == days[j]) { counter += 1; } } } System.out.println(counter); } }