Tata Pick Apples Description
There is an apple tree in the Tautau's yard, and 10 apples will be produced in every fall tree. When Apple matures, Tata will run to pick apples. Tata had a 30-centimetre-high bench, and when she couldn't pick it up with her hand, she would step on the bench and try again.
Now that you know the height of 10 apples to the ground and the maximum height you can reach when the Tata handle is stretched, help Tata calculate the number of apples she can pick. If she touches an apple, the Apple will fall.
Format input Format
The input includes two rows of data. The first line contains 10 integers from 100 to 200 (including 100 and 200), each representing 10 apples to the ground height, and two adjacent integers separated by a space. The second line includes only an integer (in centimeters) between 100 and 120 (containing 100 and 120), indicating the maximum height that the Tata can reach when the handle is stretched.
Output format
The output includes one row, which contains only an integer that represents the number of apples that Tata can pick up.
Example 1 Sample Input 1
100 200 150 140 129 134 167 198 200 111110
Sample Output 1
5
Limit
1s per test point
Water problem, big simulation
#include <cstdio>int main () {//freopen ("apple.in", "R", stdin);//freopen ("Apple.out", "w", stdout); int apple[11] , Height,ans = 0;for (int i = 1;i <= 10;i++) scanf ("%d", &apple[i]), scanf ("%d", &height); height + = 30;for (int i = 1;i <= 10;i++) if (Apple[i] <= height) ans++;p rintf ("%d", ans); return 0;}
NOIP Universal group 2005 Tata Apple picking