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

TOP

返回列表