# 11001: 【原1001】二哥摘苹果

### 题目描述

author: xjia 原OJ链接：https://acm.sjtu.edu.cn/OnlineJudge-old/problem/1001

## Sample Input

177 40 10
180 151 152 193 168 255 278 303 211 217


## Sample Output

7


## FineArtz's solution

/* 二哥摘苹果 */
#include <iostream>
using namespace std;

int main(){
int h, l, n;
cin >> h >> l >> n;
int sum = 0;
for (int i = 1; i <= n; ++i){
int t;
cin >> t;
if (h + l >= t) ++sum;
}
cout << sum << endl;
return 0;
}


## ligongzzz's solution

#include <iostream>
using namespace std;

int main() {
int H, h, n, num = 0;
cin >> H >> h >> n;
for (int i = 0; i < n; i++) {
int t;
cin >> t;
if (H + h >= t) {
num++;
}
}
cout << num << endl;
}


## LuminousXLB's solution

// 1001. 二哥摘苹果
// #383031 正确 / 分数：100 / 时间：28ms / 内存：10780kb
#include <iostream>

using namespace std;

int main() {
int shengao, dengzi, total;

cin >> shengao >> dengzi >> total;
int height = shengao + dengzi;
int apple, cnt = 0;
for (int i = 0; i < total; i++) {
cin >> apple;
if (apple <= height) {
cnt++;
}
}
cout << cnt << endl;
return 0;
}


## satgo1546's solution

#include <iostream>
using namespace std;

int main(int argc, char *argv[]) {
int x, y, s = 0;
cin >> x >> y >> argc;
x += y;
while (argc--) {
cin >> y;
s += (x >= y);
}
cout << s << endl;
return 0;
}


## victrid's solution

#include <iostream>

using namespace std;

int main()
{
int sh, dh, h, n, app;
int m = 0;
cin >> sh >> dh >> n;
h = sh + dh;
for (int i = 0; i < n; i++)
{
cin >> app;
if (app <= h)
m++;
}
cout << m;
return 0;
}