2 条题解
-
0
呵呵
#include <bits/stdc++.h> using namespace std; int n, ans, x, y, a[105]; bool cmp(int x, int y) { return x > y; } int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; cin >> x >> y; sort (a + 1, a + n + 1, cmp); for (int i = 1; i <= n; i++) { if (a[i] >= x && a[i] <= y) { cout << a[i] << " "; ans++; } } cout << endl; cout << ans << endl; return 0; }
- 1
信息
- ID
- 1079
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 18
- 已通过
- 17
- 上传者