8 solutions
-
1
import java.util.Scanner; public class Main2 {
public static void main(String[] args) { Scanner sc = new Scanner(System.in); //定义存储苹果高度的数组 int []hewightArr = new int[10]; for (int i = 0; i < 10; i++) { hewightArr[i] = sc.nextInt(); } //定义触及到的高度 int hewight = sc.nextInt() + 30; //定义可以摸到的苹果数量 int count = 0; for (int i = 0; i < 10; i++) { if (hewightArr[i] <= hewight) { count++; } } System.out.println(count); }}
Information
- ID
- 5104
- Time
- 1000ms
- Memory
- 125MiB
- Difficulty
- 1
- Tags
- # Submissions
- 544
- Accepted
- 385
- Uploaded By