1 #include2 #include 3 using namespace std; 4 5 void main() 6 { 7 //&调用外部 8 //function fun = [&]()->void {cout << "hello" << endl; fun(); }; 9 function fun = [&](int i)10 {11 if (i == 0)12 {13 return 0;14 }15 else16 {17 cout << i << endl;18 fun(i-1);19 }20 };21 fun(100);22 system("pause");23 }