@@ -0,0 +1,2014 @@
+import java.text.MessageFormat;%0Aimport java.util.Scanner;%0A%0Apublic class Diamond %7B%0A    public static void main(String%5B%5D args) %7B%0A        Scanner scanner = new Scanner(System.in);%0A        int n = Integer.parseInt(scanner.nextLine());%0A        int dashes = (n - 1) / 2;%0A        int middleDashes = 1;%0A        int stars = 1;%0A        int oddOrEven = 1;%0A%0A        if (n %25 2 == 0) %7B%0A            stars = 2;%0A            middleDashes = 2;%0A            oddOrEven = 0;%0A        %7D%0A        if (n == 1) %7B%0A            System.out.println(%22*%22);%0A        %7D%0A        else if (n == 2) %7B%0A            System.out.println(%22**%22);%0A        %7D%0A        else %7B%0A            for (int i = 0; i %3C n / 2 + oddOrEven; i++) %7B%0A                if (i == 0) %7B%0A                    System.out.println(%0A                        MessageFormat.format(%22%7B0%7D%7B1%7D%7B0%7D%22, repeatStr(%22-%22, (n - 1) / 2),%0A                        repeatStr(%22*%22, stars))%0A                    );%0A                %7D else %7B%0A                    dashes--;%0A                    System.out.println(%0A                        MessageFormat.format(%22%7B0%7D*%7B1%7D*%7B0%7D%22, repeatStr(%22-%22, dashes),%0A                        repeatStr(%22-%22, middleDashes))%0A                    );%0A                    middleDashes += 2;%0A                %7D%0A            %7D%0A            dashes = 0;%0A            middleDashes -= 2;%0A%0A            for (int i = 0; i %3C (n + 1) / 2 - 2; i++) %7B%0A                dashes++;%0A                middleDashes -= 2;%0A                System.out.println(%0A                    MessageFormat.format(%22%7B0%7D*%7B1%7D*%7B0%7D%22, repeatStr(%22-%22, dashes),%0A                    repeatStr(%22-%22, middleDashes))%0A                );%0A            %7D%0A            System.out.println(%0A                MessageFormat.format(%22%7B0%7D%7B1%7D%7B0%7D%22, repeatStr(%22-%22, (n - 1) / 2),%0A                repeatStr(%22*%22, stars))%0A            );%0A        %7D%0A    %7D%0A%0A    private static String repeatStr(String str, int count) %7B%0A        StringBuilder sb = new StringBuilder();%0A        for (int i = 0; i %3C count; i++) %7B%0A            sb.append(str);%0A        %7D%0A        return sb.toString();%0A    %7D%0A%7D%0A

Create 10.Diamond.java