run time error java

package javaapplication6;

import java.util.Scanner;

public class JavaApplication6 {

public static void main(String[] args) {

int i,j=0,k=0;
Scanner s=new Scanner(System.in);
int num=s.nextInt();
for(i=1;i<=num/2;i++)
{
j=num%i;
if(j==0)
{
k++;
}
}
System.out.println(k);

}

}
can anyone tell me what is the problem?.it’s working fine in net beans IDE.But when i try to submit here it is showing run time error…

You are not following the input specifications correctly.

You are only taking one number as input but you are supposed to take t as input in the first line and then you are supposed to take t test cases as input.

Each of these test cases consist of an integer n as input in the first line and then n numbers in the next line.

Here’s the link to my solutions of this problem, I hope by taking a look at these solutions, you will understand how to take the input in this problem. The solutions are in both Java and c++.

I suggest that you refer the solution only to understand how to take the input and then try to make your own logic for the problem. If you still cannot understand then refer to the Editorial of the problem and then the solution.
Happy coding!

Remove package declaration. And class should be named Main. If you want to name your class something else the class should not be public.