<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/******************************************************************************
 *  Compilation:  javac Ex.java
 *  Execution:    java Ex N
 *  
 *  Prints out an X of radius N like the one below.
 *
 *  % java Ex 3
 *  * . . . . . * 
 *  . * . . . * . 
 *  . . * . * . . 
 *  . . . * . . . 
 *  . . * . * . . 
 *  . * . . . * . 
 *  * . . . . . * 
 *
 *  % java Ex 5
 *  * . . . . . . . . . * 
 *  . * . . . . . . . * . 
 *  . . * . . . . . * . . 
 *  . . . * . . . * . . . 
 *  . . . . * . * . . . . 
 *  . . . . . * . . . . . 
 *  . . . . * . * . . . . 
 *  . . . * . . . * . . . 
 *  . . * . . . . . * . . 
 *  . * . . . . . . . * . 
 *  * . . . . . . . . . * 
 *
 ******************************************************************************/

public class Ex {

    public static void main(String[] args) { 
        int N = Integer.parseInt(args[0]);

        for (int i = -N; i &lt;= N; i++) {
            for (int j = -N; j &lt;= N; j++) {
                if ((i == -j) || (i == j)) System.out.print("* ");
                else                       System.out.print(". ");
            }
            System.out.println();
        }
    }
}
</pre></body></html>