C++ 编程练习:量子眼镜扫描通道区域
#include
int area[15], n, x, y;
void scan(int x, int y) { for (int i = x; i <= y; i++) { area[i] = 1; } }
int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> x >> y; scan(x, y); } for (int i = 1; i <= 10; i++) { if (area[i] == 0) { cout << i << " "; } } return 0; }
原文地址: https://www.cveoy.top/t/topic/qe4A 著作权归作者所有。请勿转载和采集!