fork download
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int n = 3;
  8. function<void(int)> f; f = [&f](int i){ if (i > 1) { cout << "func(a, "; f(i-1); cout << ")"; } else cout << "a"; }, f(n);
  9. return 0;
  10. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
func(a, func(a, a))