- #include<iostream>
- #include<cstdlib>
- using namespace std;
- void welcome4(int i){
- cout<<"這裡是welcome4函式,我接到的參數是:"<<i<<endl;
-
- if(i==0)
- {
- cout<<"結束"<<endl;
- }
- else{
- i--;
- welcome4(i);
- }
- }
- int main()
- {
- cout<<"這裡是main函式,準備進入副程式囉!"<<endl;
- system("pause");
- int i;
- cin>>i;
- welcome4(i);
- return 0;
- }
複製代碼 |