返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. void page(string sentence,int times)
  5. {
  6.     for(int i=0;i<times;i++)
  7.     {
  8.         cout<<sentence<<endl;
  9.     }
  10. }
  11. int main()
  12. {
  13.     string sentence;
  14.     int times=0;
  15.     cout<<"罰寫內容?"<<endl;
  16.     cin>>sentence;
  17.     cout<<"次數?"<<endl;
  18.     cin>>times;
  19.     page(sentence,times);
  20.     system("pause");
  21.     return 0;
  22. }
複製代碼

TOP

返回列表