编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习9

#include <iostream>
using namespace std;
int main()
{
 int num;
 cout<<"Enter number of rows: ";
 (cin>>num).get();
 for(int i=1;i<=num;i++)
 {
  for(int j=num-i;j>0;j--)
   cout<<".";
  for(int k=1;k<=i;k++)
   cout<<"*";
  cout<<endl;
 }
 system("pause");
 return 0;
}

原文地址:https://www.cnblogs.com/lynnycy/p/3450446.html