import java.time.LocalDate; public class No188 { public static void main(String[] args) { LocalDate start = LocalDate.of(2015, 1, 1); LocalDate end = LocalDate.of(2015, 12, 31); int count = 0; for (LocalDate date = start; date.isBefore(end) || date.isEqual(end); date = date.plusDays(1)) { int month = date.getMonth().getValue(); int day = date.getDayOfMonth(); int firstDigit = day / 10; int secondDigit = day % 10; if (month == firstDigit + secondDigit) { count++; } } System.out.println(count); } }