I am getting a NoSuchElementException error in the following code while running it here but I am not getting any error when I run it on eclipse.
Any help would be appreciated .
problem :http://www.codechef.com/problems/HS08TEST
code:
import java.util.; import java.io.;
public class atm
{
public static void main(String[] args)
{
double w,c;
Scanner input=new Scanner(System.in);
w=input.nextDouble(); //it is giving error at this line
c=input.nextDouble();
if(w%5==0&&w<=(c+.5))
{
c=c-w-.5;
System.out.printf("%.2f",c);
}
else if(w%5==0&&w>c)
System.out.printf("%.2f",c);
else if(w%5!=0)
System.out.printf("%.2f",c);
}
}