Why i am getting error in this code. Why my test cases are failed?

import java.util.*;
import java.lang.Math;
public class Main {
public static void main(String args[]) {

	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int temp = n;

	int deci = 0;
	int i =0;
	while(temp>0){

        int x = (int)Math.pow(2,i);
		int lastdig = temp%10;
		deci+= lastdig*x;
		temp = temp/10;
		i++;

	}
	
	System.out.println(deci);





}

}

hey @LakshmiPrasanna0303 you forgot to take input N as the number of cases .take that and perform the function for each test case

I’m not able to understand . Please explain clearly…

@LakshmiPrasanna0303 “The first line contains N , the number of binary numbers. Next N lines contain N integers each representing binary represenation of number.”
you forgot to take the input N