借鉴:https://blog.csdn.net/navicheung/article/details/81281945
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str="* * * * *";
int i, j;
for (i=0; i<10; i++)
if (i%2==0){
for (j=0; j<i; cout<<' ', j++);
cout<<str<<endl;
}
system("pause");
return 0;
}