问题遇到的现象和发生背景
在idea上可以运行,但是oj上运行错误
问题相关代码,请勿粘贴截图
import java.util.*;
public class Main{
public static void main (String args[])
{
System.out.println("Enter v0, v1, and t :");
Scanner cin= new Scanner(System.in);
double a;double b;double c;
a= cin.nextDouble();
b= cin.nextDouble();
c= cin.nextDouble();
double m=1.0;
m=(b-a)/c;
System.out.println("The average acceleration is" + String.format("%.4f", m));
}
}
运行结果及报错内容
Exception in thread "main" java.util.InputMismatchException
at java.base/java.util.Scanner.throwFor(Scanner.java:939)
at java.base/java.util.Scanner.next(Scanner.java:1594)
at java.base/java.util.Scanner.nextDouble(Scanner.java:2564)
at Main.main(Main.java:8)
-time_space_table:-
/1930/sample.in:RE mem=18044k time=191ms