Exception in thread "main" java.util.NoSuchElementException, Java我运行时报错

publicstaticvoidplaying(Stringnuser[],Stringnplayer1[],Stringnplayer2[],Stringdeck[],... public static void playing(String nuser[], String nplayer1[], String nplayer2[], String deck[], int z) {
Scanner input = new Scanner(System.in);
if (z == 1) {
for (int j = 0; j < 100000; j++) {
for (int k = 0; k < 100000; k++) {
System.out.println("It's your turn. Please play card(s):");
p = input.next();
if (p.equalsIgnoreCase("0")) {
for (int i = 0; i < 54; i++) {
if (p.equalsIgnoreCase(deck[i])) {
c = i;
i=54;
}
else{
System.out.println("The card you enter is wrong.");
p=input.nextLine();
i--;
}
}
if (c <= b) {
System.out.println("The card you enter is wrong.");
k--;
} else if (c > b) {
for (int i = 0; i < 18; i++) {
if (p.equalsIgnoreCase(nuser[i])) {
ulist.remove(i);
b = c;
}
}
if (ulist.isEmpty()) {
System.out.println("You are the winner!");
k = 100000;
j = 100000;
} else {
for (int i = 0; i < 18; i++) {
if (p1[i] > b) {
System.out.println("Player1 is playing:" + nplayer1[i]);
p1list.remove(i);
b = p1[i];
i = 18;
}
}
if (p1list.isEmpty()) {
System.out.println("Player1 is the winner!");
k = 100000;
j = 10000;
} else {
for (int i = 0; i < 18; i++) {
if (p2[i] > b) {
System.out.println("Player2 is playing:" + nplayer2[i]);
p2list.remove(i);
b = p2[i];
i = 18;
}
}
if (p2list.isEmpty()) {
System.out.println("Player2 is the winner!");
k = 100000;
j = 100000;
}
System.out.println("This is your new cards:");
System.out.print(ulist);
System.out.println("");
}
}
}
}
}

}

}
}
}
我删减了一些内容,重点是p = input.next();可能有问题,这个就是237行。
展开
 我来答
花开后丶终会落
2018-01-01 · 超过26用户采纳过TA的回答
知道答主
回答量:93
采纳率:62%
帮助的人:27.2万
展开全部
main方法呢
更多追问追答
追问

已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式