返回列表 發帖
本帖最後由 楊惇翔 於 2023-4-29 22:04 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;

  4. void  print()
  5. {
  6.     string str;
  7.     int time;
  8.     cout<<"罰寫內容:";
  9.     getline(cin,str);
  10.     cout<<"罰寫次數:";
  11.     cin>>time;
  12.         for(int i=0;i<time;i++)
  13.     {
  14.         cout<<str<<endl;        
  15.     }   
  16. }   
  17. int main()
  18. {
  19.     print();
  20.     system("pause");
  21.     return 0;   
  22. }
複製代碼

TOP

返回列表