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

TOP

返回列表