#include <stdio.h> #include "math.h" #include "stdlib.h" #include "unistd.h" int main(void) { int h, line, t; scanf("%i", &h); for (int v = h - 1; v >= -(h - 1); --v) { line = h - abs(v); for (t = 0; t < h - line; ++t) printf(" "); for (t = 0; t < 2 * line - 1; ++t) { if (t == 0 || t == 2 * line - 1 - 1) printf("*"); else printf(" "); } printf("\n"); } }
标签:int,rhombus,++,printf,print,line,include From: https://www.cnblogs.com/dissipate/p/17238455.html