#include <iostream> using namespace std; int main() { cout << add(5) << endl; //in ra 5 cout << add(2)(2) << endl; // in ra 4 cout << add(-1)(10)(100) << endl; //in ra 108 cout << add(4)(3)(2)(1) << endl; // in ra 10 system("pause"); return 0; }
QUOTE:Có phải là : #include <algorithm> ko hả anh ?
struct add { int x; add(int x) : x(x) {} add operator()(int y) { return add(x+y); } }; ostream& operator << (ostream &bo, add a) { cout << a.x ; return bo; }