- #include<iostream>
- #include<cstdlib>
- using namespace std;
- void welcome4(int i){
- cout<<"這裡是welcome4函式,我接到的參數是:"<<i<<endl;
- }
- void welcome3(){
- cout<<"這裡是welcome3函式,準備進入welcome4函式囉!"<<endl;
- cout<<"順便回傳參數!"<<endl;
- int a;
- cout<<"你要回傳的參數是:";
- cin>>a;
- system("pause");
- welcome4(a);
- }
- void welcome2(){
- cout<<"這裡是welcome2函式,準備進入welcome3函式囉!"<<endl;
- system("pause");
- welcome3();
- }
- void welcome1(){
- cout<<"這裡是welcome1函式,準備進入welcome2函式囉!"<<endl;
- system("pause");
- welcome2();
- }
- int main(){
- cout<<"這裡是主函式,準備進入welcome1函式囉!"<<endl;
- system("pause");
- welcome1();
- return 0;
- }
複製代碼 |