Please tell my error

import java.util.Scanner;

public class main {

public static void main(String[] args) {
	
	Scanner scn = new Scanner(System.in);
	int N = scn.nextInt();

int nsp=N;
int nst=0;
int row=1;
while(row<=N) {
int temp = 1;
for(int csp=1;csp<=nsp;csp++) {
System.out.print(temp+++"\t");
}
for(int cst=1;cst<=nst;cst++) {
System.out.print("*\t");
}
System.out.println();
if(row<N/2)
{row++;
nsp–;
nst++;}
else {row++;
nsp–;
nst+=2;

}

}
}

}

Your code is working fine on my system. Just do nsp-- instead of nsp-.
Also, check the name of your class file. It should be Main and not main

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.