标签:
1 100 200 150 140 129 134 167 198 200 111 110
5
package acm03; import java.util.Scanner; public class Main1 { private static final int HEIGHT = 30; public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); for (int i = 0;i<n;i++) { int [] array = new int[10]; for (int j = 0;j<array.length;j++) { array[j] = input.nextInt(); } int height = input.nextInt(); int sum = height + HEIGHT; int result = count(array,sum); System.out.println(result); } } private static int count(int[] array,int sum) { int count = 0; for (int i = 0;i<array.length;i++) { if (array[i] <= sum) { count++; }else { continue; } } return count; } }
标签:
原文地址:http://www.cnblogs.com/airycode/p/5508973.html