crx-Pattern 27 can you help me find error?

Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int row = 1;
int nst = 1;
int nsp = n - 1;
int val;

	while (row <= n) {
		val = 1;

		for (int csp = 1; csp <= nsp; csp++) {
			System.out.print("\t");
		}

		for (int cst = 1; cst <= nst; cst++) {
			System.out.print(val + "\t");

			if (cst <= nst / 2) {
				val++;
			} else

			{
				val--;
			}

		}

	}