粘贴此代码后,为什么在SPOJ中出现运行时NZEC错误?
using System;
public class Test
{
public static void Main(string[] args)
{
int t = int.Parse(Console.ReadLine());
while (t < 1 || t > 100)
{
t = int.Parse(Console.ReadLine());
}
string[] words = new string[t];
for (int i = 0; i < t; i++)
{
string word = Console.ReadLine();
while (word.Length > 100 || word.Length < 1)
{
word = Console.ReadLine();
}
words[i] += word;
}
foreach (var item in words)
{
for (int i = 0; i < item.Length / 2; i+=2)
{
Console.Write(item[i]);
}
Console.WriteLine();
}
}
}
我已经尝试了所有我能想到的输入,并且运行正常。是什么使它抛出非零错误?提前致谢。
您不能将SPOJ提交文件放在一个包中,因此请删除声明:
package spoj.test;
非零退出代码可能来自JVM无法加载类以运行它。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句