error :
Compiling failed with exitcode 1, compiler output:
Main.java:3: error: cannot find symbol
public static void main(string args[]) {
^
symbol: class string
location: class Main
1 error.
my code:
Scanner s = new Scanner(System.in);
int n = s.nextInt();
// row
int row = 1;
// work
int nst = n;
while (row <= n) {
for (int cst = 1; cst <= nst; cst++) {
if (row == ((n / 2) + 1) || cst == nst / 2 + 1) {
System.out.print("*");
} else if (cst == 1 && row == 1) {
System.out.print("*");
} else if (row == 1 && cst >= nst / 2 + 1) {
System.out.print("*");
} else if (row > 1 && row <= n / 2 && cst == 1) {
System.out.print("*");
} else if (row > n / 2 + 1 && row < n && cst == nst) {
System.out.print("*");
} else if (row == n && cst <= nst / 2) {
System.out.print("*");
} else if (row == n && cst == nst) {
System.out.print("*");
} else {
System.out.print(" ");
}
}
// preparation
System.out.println();
row++;
}