fork download
  1. #include <iostream>
  2. #include <numeric>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. bool isDivide( int number , vector<int> dividers )
  8. {
  9. return number % accumulate( dividers.begin() , dividers.end() , 1 , multiplies<int>() ) == 0;
  10. }
  11.  
  12. int main()
  13. {
  14. cout << isDivide( 30 , {3,5,10} );
  15. return 0;
  16. }
Success #stdin #stdout 0s 4412KB
stdin
Standard input is empty
stdout
Standard output is empty