返回列表 發帖

小星星 1

試運用巢狀迴圈完成以下圖案:

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(______________)
  7.    {
  8.        for(______________)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼

TOP

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     for(int i=1; i<=5; i++)
  7.     {
  8.             for(int j=1; j<=i; j++)
  9.             {
  10.                 cout<<"*";        
  11.             }
  12.             cout<<endl;
  13.     }
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     for(int i=1; i<=5; i++)
  7.      {
  8.         for(int y=1; y<=i; y++)   
  9.         {
  10.            cout<<"*";     
  11.         }
  12.         cout<<endl;   
  13.      }   
  14.                   
  15.     system("pause");
  16.     return 0;   
  17. }
  18.   
複製代碼

TOP

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼
hahahahahahahaha

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      for(int i=1; i<=5; i++)
  7.    {
  8.        for(int a=1; a<=i; a++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼

TOP

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼

TOP

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"*";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
複製代碼

TOP

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    for(int i=1; i<=5; i++)
  7.    {
  8.        for(int j=1; j<=i; j++)
  9.        {
  10.             cout<<"野馬GT";
  11.        }
  12.        cout<<endl;
  13.    }
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int d=0;
  7.     for(int e=1; e<=5; e++)  
  8.     {
  9.         
  10.       
  11.    
  12.     for(int i=1; i<=e; i++)  
  13.     {
  14.       cout<<"*";
  15.      
  16.     }
  17.     cout<<endl;   
  18.      }
  19.    
  20.     system("pause");
  21.     return 0;   
  22. }
複製代碼

TOP

返回列表