I am getting error as "Exception in thread "main" java.util.NoSuchElementException" . Please tell me what is error in my code . Because when i run this code in eclipse i didn't get any error

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int i =1;
System.out.println(i);
int nst = 2;
int row= 0;
while(row<=n-1) {
int cst=1;

		while(cst<=nst) {
			if(cst==1|cst==nst) {
			System.out.print(i);
			cst++;
		}
			else {
				int j =0;
				System.out.print(j);
				cst++;
			}
		}
		
		System.out.println();
		i++;
		nst++;
		row++;
	}



}

}

I tried to submit the same code and I am not getting any such type of error, although I am getting wrong answer, so you please look into it.