// Produces standard times table 	
	
public class MultiplicationTable {	
	// main(): application entry point 	
	public static void main(String[] args) {	
		final int MAX_FACTOR = 12;	
	
		// display table header 	
		System.out.print(" * |");	
		for (int i = 0; i <= MAX_FACTOR; ++i) {	
			if (i < 10) {	
				System.out.print("   " + i);	
			}	
			else {	
				System.out.print("  " + i);	
			}	
		}	
		System.out.println();	
		for (int i = 0; i <= MAX_FACTOR+1; ++i) {	
			System.out.print("----");	
		}	
		System.out.println();	
	
		// display table 	
		for (int i = 0; i <= MAX_FACTOR; ++i) {	
			// display row label 	
			if (i < 10) {	
				System.out.print(" " + i + " |");	
			}	
			else {	
				System.out.print(i + " |");	
			}	
	
			// display row entries 	
			for (int j = 0; j <= MAX_FACTOR; ++j) {	
				// compute entry 	
				int product = i * j;	
	
				// pretty-print entry 	
				if (product < 10) {	
					System.out.print("   " + product);	
				}	
				else if (product < 100) {	
					System.out.print("  " + product);	
				}	
				else {	
					System.out.print(" " + product);	
				}	
			}	
	
			System.out.println();	
		}	
	}	
}	
	
