#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, l, r;
if (!(cin >> n >> l >> r)) return 0;
int ans = 0;
for (int i = 0; i < n; ++i) {
int x;
cin >> x;
// 如果 x 是偶数且位于 [l, r],则计数
if (x % 2 == 0 && l <= x && x <= r) {
++ans;
}
}
cout << ans << "\n";
return 0;
}
# 读取输入
n, l, r = map(int, input().split())
arr = list(map(int, input().split()))
ans = 0
for x in arr:
# 如果 x 是偶数且在 [l, r] 区间内,则计数
if x % 2 == 0 and l <= x <= r:
ans += 1
print(ans)
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int l = sc.nextInt();
int r = sc.nextInt();
int ans = 0;
for (int i = 0; i < n; i++) {
int x = sc.nextInt();
// 如果 x 是偶数且位于 [l, r],则计数
if (x % 2 == 0 && x >= l && x <= r) {
ans++;
}
}
System.out.println(ans);
sc.close();
}
}
小红定义一个正整数x 为完美偶数,当且仅当:
小红拿到了一长度为n 的数组(a1,a2,...,an),她想知道该数组中有多少个完美偶数。
第一行输入三个整数n,l,r(1≤n≤100;1≤l≤r≤100) ,表示数组长度和区间。
第二行输入n 个整数(a1,a2,...an) ,(1≤ai≤100)。
输出一个整数,表示数组中完美偶数的数量。
输入
5 3 8
1 2 6 8 7
输出
2