📅  最后修改于: 2022-03-11 14:44:54.014000             🧑  作者: Mango
template class range {
static bool contains(int i) { return min <= i && i < max; } // In C++, ranges usually are half-open.
};
int age = 23;
if (range<18,30>::contains(age)) {
//Your desired code
}