標題:
函式的建立與執行 (三)
[打印本頁]
作者:
鄭繼威
時間:
2023-3-1 19:00
標題:
函式的建立與執行 (三)
#include<iostream>
#include<cstdlib>
using namespace std;
void welcome4(int i){
cout<<"這裡是welcome4函式,我接到的參數是:"<<i<<endl;
}
void welcome3(){
cout<<"這裡是welcome3函式,準備再往下呼叫welcome4囉!順便傳參數"<<endl;
int i;
cout<<"你要傳多少過去?";
cin>>i;
cout<<"你要傳"<<i<<",準備再往下呼叫welcome4囉!"<<endl;
system("pause");
welcome4(i);
}
void welcome2(){
cout<<"這裡是welcome2函式,準備再往下呼叫welcome3囉!"<<endl;
system("pause");
welcome3();
}
void welcome1()
{
cout<<"這裡是welcome1函式,準備再往下呼叫welcome2囉!"<<endl;
system("pause");
welcome2();
}
int main()
{
cout<<"這裡是main函式,準備進入副程式囉!"<<endl;
system("pause");
welcome1();
return 0;
}
複製代碼
作者:
黃裕恩
時間:
2023-3-1 21:08
#include<iostream>
#include<cstdlib>
using namespace std;
void welcome4(int i){
cout<<"這裡是welcome4函式,我接到的參數是:"<<i<<endl;
}
void welcome3(){
cout<<"這裡是welcome3函式,準備再往下呼叫welcome4囉!順便傳參數"<<endl;
int i;
cout<<"你要傳多少過去?";
cin>>i;
cout<<"你要傳"<<i<<",準備再往下呼叫welcome4囉!"<<endl;
system("pause");
welcome4(i);
}
void welcome2(){
cout<<"這裡是welcome2函式,準備再往下呼叫welcome3囉!"<<endl;
system("pause");
welcome3();
}
void welcome1()
{
cout<<"這裡是welcome1函式,準備再往下呼叫welcome2囉!"<<endl;
system("pause");
welcome2();
}
int main()
{
cout<<"這裡是main函式,準備進入副程式囉!"<<endl;
system("pause");
welcome1();
return 0;
}
複製代碼
作者:
李彣
時間:
2023-3-1 21:10
#include<iostream>
#include<cstdlib>
using namespace std;
void welcome4(int i)
{
cout<<"這裡是welcome4函式,接到的參數是:"<<i<<endl;
}
void welcome3()
{
cout<<"這裡是welcome3函式,準備再往下呼叫welcome4囉!順便傳參數"<<endl;
int i;
cout<<"你要傳多少過去?";
cin>>i;
cout<<"你要傳"<<i<<",準備再往下呼叫welcome4囉!"<<endl;
system("pause");
welcome4(i);
}
void welcome2()
{
cout<<"這裡是welcome2函式,準備再往下呼叫welcome3囉!"<<endl;
system("pause");
welcome3();
}
void welcome1()
{
cout<<"這裡是welcome1函式,準備再往下呼叫welcome2囉!"<<endl;
system("pause");
welcome2();
}
int main()
{
cout<<"這裡是main函式,準備進入副程式囉!"<<endl;
system("pause");
welcome1();
return 0;
}
複製代碼
作者:
林劭澧
時間:
2023-3-1 21:13
#include<iostream>
#include<cstdlib>
using namespace std;
void welcome4(int i)
{
cout<<"這裡是welcome4函式,我接到的參數是:"<<i<<endl;
}
void welcome3(){
cout<<"這裡是welcome3函式,準備再往下呼叫welcome4囉!順便傳參數"<<endl;
int i;
cout<<"你要傳多少過去?";
cin>>i;
cout<<"你要傳"<<i<<",準備再往下呼叫welcome4囉!"<<endl;
system("pause");
welcome4(i);
}
void welcome2(){
cout<<"這裡是welcome2函式,準備再往下呼叫welcome3囉!"<<endl;
system("pause");
welcome3();
}
void welcome1()
{
cout<<"這裡是welcome1函式,準備再往下呼叫welcome2囉!"<<endl;
system("pause");
welcome2();
}
int main()
{
cout<<"這裡是main函式,準備進入副程式囉!"<<endl;
system("pause");
welcome1();
return 0;
}
複製代碼
作者:
林劭杰
時間:
2023-3-1 21:13
#include<iostream>
#include<cstdlib>
using namespace std;
void welcome4(int i){
cout<<"這裡是welcome4函式,我接到的參數是:"<<i<<endl;
}
void welcome3(){
cout<<"這裡是welcome3函式,準備再往下呼叫welcome4囉!順便傳參數"<<endl;
int i;
cout<<"你要傳多少過去?";
cin>>i;
cout<<"你要傳"<<i<<",準備再往下呼叫welcome4囉!"<<endl;
system("pause");
welcome4(i);
}
void welcome2(){
cout<<"這裡是welcome2函式,準備再往下呼叫welcome3囉!"<<endl;
system("pause");
welcome3();
}
void welcome1()
{
cout<<"這裡是welcome1函式,準備再往下呼叫welcome2囉!"<<endl;
system("pause");
welcome2();
}
int main()
{
cout<<"這裡是main函式,準備進入副程式囉!"<<endl;
system("pause");
welcome1();
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2