返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<cmath>
  4. using namespace std;
  5. void tri(int x)
  6. {
  7.      for(int i=1;i<=x;i++)
  8.      {
  9.            cout<<"歡迎光臨"<<endl;
  10.      }   
  11.       
  12. }
  13. int main()
  14. {
  15.     int a;
  16.     cout<<"請輸入次數:";
  17.     cin>>a;
  18.     tri(a);
  19.     system("pause");  
  20.     return 0;   
  21. }
複製代碼

TOP

返回列表