在Code Jam的基础代码中出现运行时错误。

huangapple go评论59阅读模式
英文:

Getting runtime error in basic code in code jam

问题

/*包无论什么 //请勿在此处编写包名称*/

import java.util.*;

class Nested {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while (t-- > 0) {
            String input = in.nextLine();
            //solve(input);
        }
    }
}

我正在传递以下内容作为输入:

1

1

但是它显示运行时错误...不知道为什么,因为在geeksforgeeks ide上运行得很好。

英文:

/*package whatever //do not write package name here */

import java.util.*;

class Nested {
    public static void main (String[] args) {
        Scanner in=new Scanner(System.in);
        int t=in.nextInt();
        while(t-->0)
        {
            String input=in.nextLine();
            //solve(input);
        }
    }
    
}

I am passing
>1
>
>1

as input but it is showing me runtime error...don't know why because its working fine on geeksforgeeks ide

答案1

得分: 2

Code Jam接受类名作为Solution。
那就是问题所在!

非常感谢大家的帮助!

英文:

Code Jam accept classname as Solution
That was the issue!

Thanks a lot everyone for helping!

huangapple
  • 本文由 发表于 2020年4月5日 05:17:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/61034914.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定