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

TOP

返回列表