// remove_if_divides.C
// ----------------------------------------------------------------
// COMP 290-001: Algorithm Library Design, Lutz Kettner, 01/11/2000
// Example from Alexander Stepanov and Meng Lee. The Standard Template
// Library. http://www.cs.rpi.edu/~musser/doc.ps, 1995, adopted to
// the standard C++ library.

#include <iostream>
#include <algorithm>
#include <iterator>
#include <functional>

using namespace std;

int main( int argc, char** argv) {
    if ( argc != 2)
        throw( "usage: remove_if_divides integer\n");
    remove_copy_if( istream_iterator<int>(cin), istream_iterator<int>(),
                    ostream_iterator<int>(cout, "\n"),
                    not1( bind2nd( modulus<int>(), atoi( argv[1]))));
    return 0;
}


