import java.util.Scanner; /** * TODO(you): Purpose of your solution */ public class Solution { /** * Parse formatted data from standard input. */ private Scanner input = null; /** * Start the execution of the solution. * @param args Command line arguments */ public static void main(final String[] args) { // This try calls solution.close() automatically Solution solution = new Solution(); solution.start(); } /** * Start the solution. */ public void start() { // Create object to read data from standard input this.input = new Scanner(System.in); // Run problem solution this.run(); // Close the scanner of standard input this.input.close(); } /** * Run the solution. This method is called from main(). */ public void run() { if (this.input.hasNextInt() && this.input.hasNext()); { final int branches = this.input.nextInt(); final char fill = this.input.next().charAt(0); for (int branch = 0; branch < branches; branch = branch + 1) { for (int space = 0; space < branches - branch - 1; space += 1); { System.out.print(' '); } for (int count = 1; count <= 2 * branch + 1; ++count) { System.out.print(fill); } System.out.println(); } for (int space = 1; space < branches; space++) { System.out.print(' '); } System.out.println(fill); } } }