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

TOP

TOP

返回列表