package javaapplication1; /** * * @author Nathanael */ import java.util.Scanner; import java.io.*; public class JavaApplication1 { /** * @param args the command line arguments */ public static void main(String[] args) throws Exception { // TODO code application logic here String[] s = new String[]{"* * ", " * *", "* * * *", "* * * * * *", "* *"}; String[] Zero = new String[]{s[3], s[3], s[2], s[2], s[2], s[2], s[2], s[3], s[3]}; String[] One = new String[]{s[4], s[4], s[4], s[4], s[4], s[4], s[4], s[4], s[4]}; String[] Two = new String[]{s[3], s[3], s[1], s[1], s[3], s[0], s[0], s[3], s[3]}; String[] Three = new String[]{s[3], s[3], s[1], s[1], s[3], s[1], s[1], s[3], s[3]}; String[] Four = new String[]{s[2], s[2], s[2], s[2], s[3], s[1], s[1], s[1], s[1]}; String[] Five = new String[]{s[3], s[3], s[0], s[0], s[3], s[1], s[1], s[3], s[3]}; String[] Six = new String[]{s[3], s[3], s[0], s[0], s[3], s[3], s[2], s[3], s[3]}; String[] Seven = new String[]{s[3], s[3], s[2], s[2], s[1], s[1], s[1], s[1], s[1]}; String[] Eight = new String[]{s[3], s[3], s[2], s[2], s[3], s[3], s[2], s[3], s[3]}; String[] Nine = new String[]{s[3], s[3], s[2], s[2], s[3], s[3], s[1], s[3], s[3]}; BufferedReader input; String Result = ""; int Result2 = 0; try { input = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Input: "); Result = input.readLine(); Result2 = Integer.parseInt(Result); /* This is used to throw an exception */ System.out.printf(Result); } catch (Exception e) { System.out.print("You have typed an invalid input: "); } for (int LineCount = 0; LineCount < 8; LineCount++) { for (int i = 0; i < Result.length() ; i++) { String CurrentNumber = Result.substring(i); if (CurrentNumber == "0") { System.out.print(Zero[LineCount]); } } } } }