C++ 编程:小可摘葡萄 - 算法题解
#include
int main() { int heights[10]; int max_height; int count = 0;
for (int i = 0; i < 10; i++) {
cin >> heights[i];
}
cin >> max_height;
for (int i = 0; i < 10; i++) {
if (heights[i] <= max_height) {
count++;
}
}
cout << count << endl;
return 0;
}
原文地址: https://www.cveoy.top/t/topic/pN7M 著作权归作者所有。请勿转载和采集!