logicnot.cpp
logicnot.cpp
#include ‹iostream.h›
#include ‹stl.h›
bool input[7] = {1, 0, 0, 1, 1, 1, 1};
int main() {
int n = 0;
count_if(input, input + 7, logical_not‹bool›(), n);
cout ‹‹ "count = " ‹‹ n ‹‹ endl;
return 0;
}
logicnot.cpp
#include ‹iostream.h›
#include ‹stl.h›
bool input[7] = {1, 0, 0, 1, 1, 1, 1};
int main() {
int n = 0;
count_if(input, input + 7, logical_not‹bool›(), n);
cout ‹‹ "count = " ‹‹ n ‹‹ endl;
return 0;
}