Java tutorial
//package com.java2s; public class Main { private static boolean checkNum(int num) { boolean needsAn = false; // eight, eleven, eighty and eighteen if (num == 11 || num == 18 || num == 8 || (num >= 80 && num < 90)) { needsAn = true; } else if (num > 1000) { num = Math.round(num / 1000); needsAn = checkNum(num); } return needsAn; } }