negate.cpp

We use cookies. Read the Privacy and Cookie Policy

negate.cpp

#include ‹iostream.h›

#include ‹stl.h›

int input[3] = {1, 2, 3};

int main() {

 int output[3];

 transform(input, input + 3, output, negate‹int›());

 for (int i = 0; i ‹ 3; i++) cout ‹‹ output[i] ‹‹ endl;

 return 0;

}