牛客网java输出0%_Java题目,总是说输出为空

package data;

import java.util.*;

public class HuaweiTest {

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);

String num=sc.nextLine();

int stuNum=Integer.parseInt(num.split(" ")[0]);

int actNum=Integer.parseInt(num.split(" ")[1]);

int[] scores=new int[stuNum];

for(int i=0;i

String input=sc.nextLine();

if(i==0){

String[] scoresStrArray=input.split(" ");

for(int j=0;j

scores[j]=Integer.parseInt(scoresStrArray[j]);

}

continue;

}

String[] actArray=input.split(" ");

int num1=Integer.parseInt(actArray[1]);

int num2=Integer.parseInt(actArray[2]);

if(actArray[0].equals("Q")){

int max=0;

int mmax=num1>num2?num1:num2;

int mmin=num1

for(int j=mmin-1;j

if(scores[j]>max){

max=scores[j];

}

}

System.out.println(max);

}

else if(actArray[0].equals("U")){

scores[num1-1]=num2;

}

}

sc.close();

}

}

您的代码已保存

答案错误:您提交的程序没有通过所有的测试用例

case通过率为10.00%

用例:

9 10

28 49 11 35 40 17 57 4 6

Q 9 9

U 9 79

Q 9 5

Q 4 8

U 2 27

U 8 40

U 4 77

U 7 71

U 4 44

U 8 51

对应输出应该为:

6

79

57

你的输出为:

空.请检查一下你的代码,有没有循环输入处理多个case

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值