📌  相关文章
📜  void count(int n) { if (n<0) cout << "n 必须是正数.." << endl; else if (n>10) cout << "完成计数..." << endl;否则 { cout << n << endl;计数(n+1); } } - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:19.437000             🧑  作者: Mango

代码示例1
void count(int n)
  {
    if (n<0)
      cout << "n must be positive.." << endl;
    else if (n>10)
     cout << "done counting..." << endl;
   else
    {
      cout << n << endl;
      count (n+1);
     }
}