返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;

  4. void round4(int x)
  5. {
  6.         cout << "這裡是round4(),我收到:" << x << endl;
  7.         system("pause");
  8. }
  9. void round3()
  10. {
  11.         int num;
  12.         cout << "這裡是round3(),即將進入round4()" << endl;
  13.         cout<<"請傳一個整數:";
  14.         cin >> num;
  15.         cout << "點擊任意鍵進入round4()" << endl;
  16.         system("pause");
  17.         round4(num);
  18. }
  19. void round2()
  20. {
  21.         cout << "這裡是round2(),即將進入round3()" << endl;
  22.         system("pause");
  23.         round3();
  24. }
  25. void round1()
  26. {
  27.         cout << "這裡是round1(),即將進入round2()" << endl;
  28.         system("pause");
  29.         round2();
  30. }
  31. int main()
  32. {
  33.         cout << "這裡是main(),準備進入副程式" << endl;
  34.         system("pause");
  35.         round1();
  36.         return 0;
  37. }
複製代碼

TOP

返回列表