Please help Me With This program

I write Correct Code But First row is have error

import java.util.Scanner;

public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);

System.out.print("Enter the number of rows: ");
int n = sc.nextInt();
int nsp = 2 *n - 1;

int nr = 2 *n + 1;
int num = n;
int a = 0;

for (int i = 1; i <= nr; i++)
{
  if (i > n + 1)
    a = nr - i + 1;
  else
    a = i;

  //numbers
  for (int cst = 1; cst <= a; cst++)
  {
    System.out.print(num);
    num--;
  }

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

  for (int cst = 1; cst <= a; cst++)
  {
    num++;
    if (num != 0)
      System.out.print(num);
  }

  if (i <= (nr) / 2)
    nsp -= 2;
  else
    nsp += 2;

  System.out.println();
}

}
}

@sandeepmaddeshiya78_2feec877c506dc09 remove System.out.print("Enter the number of rows: “);
It shouldn’t be there. Now add one more space whenever you print a number bcoz your output should be same. so whenever you’re printing a number use System.out.print(num+” ");

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.