使用Scanner.nextInt()时java.util.NoSuchElementException

时间:2017-08-01 03:19:25

标签: java

此处总新手,为什么我使用扫描仪时出错?     import java.io. *;     import java.util.Scanner;

var start = new Date().getTime();

// Insert test code here

var end = new Date().getTime();
Logger.log(end - start);

错误:

class myCode
{
   public static void main (String[] args) throws java.lang.Exception
   {
    Scanner sc = new Scanner(System.in);
    int s,v1,v2,t1,t2;
    s = sc.nextInt();
    v1=sc.nextInt();
    v2=sc.nextInt();
    t1=sc.nextInt();
    t2=sc.nextInt();
  }
}

0 个答案:

没有答案