import java.io.PrintStream;
import java.util.Arrays;
public class Phi {
/**
* Produces a string of spaces that has the character <code>c</code>
* at the three specified indices, followed by a newline.
*/
private static String row(char c, int left, int mid, int right) {
char[] line = new char[right + 1];2];
Arrays.fill(line, ' ');
line[left] = line[mid] = line[right] = c;
line[right + 1] = '\n';
return new String(line);
}
public static voidString printPhitoString(PrintStream out, char c, int size) {
StringBuilder out = new StringBuilder();
int halfWidth = (size + 1) / 2;
// Top stem
out.printlnappend(row(c, halfWidth, halfWidth, halfWidth));
// Body
for (int row = 2; row < (size + 2) / 2; row++) {
out.printlnappend(row(c, halfWidth - row, halfWidth, halfWidth + row));
}
for (int row = halfWidth; row >= 2; row--) {
out.printlnappend(row(c, halfWidth - row, halfWidth, halfWidth + row));
}
// Bottom stem
out.printlnappend(row(c, halfWidth, halfWidth, halfWidth));
return out.toString();
}
public static void main(String[] args) {
int size = Integer.parseInt(args[0]);
System.out.printf("\nNumber = %d\n"%d\n%s", size);
printPhi(System.out, toString('*', Integer.parseInt(args[0]size));
}
}