- #include<iostream>
- #include<cstdlib>
- using namespace std;
- void round4(int x)
- {
- cout << "這裡是round4(),我收到:" << x << endl;
- system("pause");
- }
- void round3()
- {
- int num;
- cout << "這裡是round3(),即將進入round4()" << endl;
- cout<<"請傳一個整數:";
- cin >> num;
- cout << "點擊任意鍵進入round4()" << endl;
- system("pause");
- round4(num);
- }
- void round2()
- {
- cout << "這裡是round2(),即將進入round3()" << endl;
- system("pause");
- round3();
- }
- void round1()
- {
- cout << "這裡是round1(),即將進入round2()" << endl;
- system("pause");
- round2();
- }
- int main()
- {
- cout << "這裡是main(),準備進入副程式" << endl;
- system("pause");
- round1();
- return 0;
- }
複製代碼 |