*
  ***
 *****
*******
 *****
  ***
   *
// 这几天奇怪了,要输出菱形程序的人好多。
#include <iostream>
#include <cmath>
int main() {
	const int row = 5; // 5行,对于行对称的,使用绝对值来做比较好
	const int max = row / 2 + 1;
	for (int i = -max + 1; i < max; ++i) {
		for (int j = 0; j < abs(i); ++j, std::cout << " ");
		for (int j = 0; j < (max - abs(i)) * 2 - 1; ++j, std::cout << "*");
		std::cout << std::endl;
	}
	return 0;
}