帮帮孩子吧一直RE,java

P1046 [NOIP2005 普及组] 陶陶摘苹果

sy_ran @ 2024-01-15 11:52:16

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner apple =new Scanner(System.in);
        int[] arr = new int[10];
        for (int j=0;j<arr.length;j++){
            arr[j]= apple.nextInt();
        }
        Scanner hand =new Scanner(System.in);
        int reach = hand.nextInt();
        int num =0;
        for (int i=0;i<10;i++){
            if (reach+30>=arr[i]){
                num++;
            }
        }
        System.out.println(num);
    }

by sy_ran @ 2024-01-15 12:23:25

原来是Scanner多写了的问题,打扰了


|