返回列表 發帖
#include<iostream>
using namespace std;

int main()
{  
  for(int i=1;i<=9;i++){
      cout << i;
          if(i<=5){
             for(int j=1;j<=i;j++){
                 cout << "*" ;  
                       
             } cout << endl;   
          }
          if(i>5){
             for(int k=(10-i);k>=1;k--){
                   cout << "*" ;   
             } cout << endl;      
          }            
  }
            
     system("Pause");
     return 0;
}
張雅淳

TOP

返回列表