Star


私信TA

用户名:1223yuan

访问量:409

签 名:

等  级
排  名 5541
经  验 1447
参赛次数 0
文章发表 3
年  龄 0
在职情况 学生
学  校 西安邮电大学
专  业

  自我简介:

TA的其他文章

判定字符位置
浏览:121
陶陶摘苹果
浏览:136

解题思路:判断

注意事项:

参考代码:

import java.util.Scanner;

public class Main {
   public static void main(String[] args) {
       Scanner scanner=new Scanner(System.in);
       int number=scanner.nextInt();//苹果的数量
       int height=scanner.nextInt();
       int heighting=height+30;
       int numbers[]=new int[number];
       for (int i = 0; i < number; i++) {
           numbers[i]=scanner.nextInt();
       }
       int count=0;
       for (int i = 0; i <number; i++) {
           if(numbers[i]>heighting){
               count++;
           }
       }
       System.out.println(count);
   }
}

 

0.0分

0 人评分

  评论区