/****************************************************************************** * This program generates license plates. * * Copyright © 2020 Richard Lesh. All rights reserved. *****************************************************************************/ import org.pureprogrammer.Utils; public class LicensePlates1 { static final String LETTERS = "ABCDEFGHJKLMNPQRTUVWXYZ"; static final String DIGITS = "0123456789"; public static void main(String[] args) { long count = 0; for (String c1 : new Utils.StringCodepointsIterable(LETTERS)) { for (String c2 : new Utils.StringCodepointsIterable(LETTERS)) { for (String c3 : new Utils.StringCodepointsIterable(LETTERS)) { for (String c4 : new Utils.StringCodepointsIterable(DIGITS)) { for (String c5 : new Utils.StringCodepointsIterable(DIGITS)) { for (String c6 : new Utils.StringCodepointsIterable(DIGITS)) { System.out.println(Utils.format("{0:c}{1:c}{2:c}-{3:c}{4:c}{5:c}", c1, c2, c3, c4, c5, c6)); ++count; } } } } } } System.out.println(Utils.join("", "Total: ", count)); } }