问题如下~
*
*.*.
*.*.*.
*.*.*.*.
*.*.*.*.*.
*.*.*.*.
*.*.*.
*.*.
*
hint 是给说用flag variable ~ 可是完全不知道什么是flag variable~
书里好像也找不到~= =
之前的一题是做了
*
***
*****
*******
*********
*******
*****
***
*
类似这样的diamond shape~
不动要怎么modify才能放点在里面~
#include <iostream>
using namespace std;
int main()
{
int a = 9;
int b;
int c = 5;
int d;
int e = 3;
do
{
b = 1;
while(b < c)
{
cout << " ";
b = b + 1;
}
c = c - 1;
a = a - 1;
d = 4;
while(d > e)
{
cout <<"*";
d = d - 1;
}
e = e - 2;
cout <<endl;
}
while(a > 4);
e = 8;
while(a > 0)
{
b = 5;
while(b > a)
{
cout << " ";
b = b - 1;
}
d = 1;
while(d < e)
{
cout <<"*";
d = d + 1;
}
e = e - 2;
a = a - 1;
cout <<endl;
}
system("pause");
return 0;
}