返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a=0,b=0,c=0;
  7.     cout<<"請輸入一整數: ";
  8.     cin>>a;
  9.     for(int n=1;n<=a;n++)
  10.     {
  11.            cout<<"請輸入星星數量: ";
  12.            cin>>c;
  13.             while(b<c)
  14.             {
  15.                       cout<<"*";
  16.                       b++;
  17.             }
  18.             b=0;
  19.             cout<<endl;
  20.     }
  21.     system("pause");
  22.     return 0;
  23. }
複製代碼

TOP

返回列表