java小萌新,题解基本没有java的,这个题为啥会越界啊
  • 板块题目总版
  • 楼主Dqh666
  • 当前回复8
  • 已保存回复8
  • 发布时间2021/2/1 20:23
  • 上次更新2023/11/5 03:59:28
查看原帖
java小萌新,题解基本没有java的,这个题为啥会越界啊
427160
Dqh666楼主2021/2/1 20:23

P5744求助求助

import java.util.Scanner;

public class text_07_培训 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		String []str = new String[n];
		
		for(int i = 0; i<n; i++) {
			
			str[i] = sc.nextLine();
			
			String[] split = str[i].split(" ");
			int age = Integer.parseInt(split[1]);
			age++;
			int score = Integer.parseInt(split[2]);
			score = (int) (score * 1.2);
			if(score > 600) {
				score = 600;
			}
			
			System.out.println(split[0] + " " + age + " " + score);
			
		}
		
		
		
		
	}

}
2021/2/1 20:23
加载中...