我有简单的方法。我不知道为什么会引发错误。提前致谢!
public static int[] Shift(int[] a)
{
if (a == null) return -1;
...
}
Cannot implicitly convert type
int
toint[]
最佳答案
如果数组为null,则返回一个int。该函数期望一个int []。您可以返回null或空白数组。
https://stackoverflow.com/questions/42769644/