fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. bool check(int a) {
  4. return 0 <= a && a < 16;
  5. }
  6.  
  7. template<typename... Args>
  8. bool check(int a, Args... args) {
  9. return (0 <= a && a < 16) && check(args...);
  10. }
  11.  
  12. int main() {
  13. cout << check(1, 12, 17) << endl;
  14. cout << check(3) << endl;
  15. cout << check(-1, 4) << endl;
  16. cout << check(1, 12, 8, 2) << endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
0
1
0
1