This code was running well in eclipse but when I tried to compile it online it showed this error.
Exception in thread "main" java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at Main.main(Main.java:15)
CODE :
import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
public static void main (String[] args)throws IOException
{
Scanner input = new Scanner(System.in);
int t=input.nextInt();//the error refers to this line
int ctr;
double i;
while(t!=0)
{
ctr=0;
double n=input.nextDouble();
for(i=1;i<=12;i++)
{
ctr=(int) (ctr+Math.floor(n/5));
n=n/5;
}
System.out.println(ctr);
}
}
}