写一个c语言程序输出金字塔
#include <stdio.h>
int main() { int i, j, rows, space;
printf("请输入金字塔的行数:");
scanf("%d", &rows);
for (i = 1; i <= rows; i++) {
    for (space = 1; space <= rows - i; space++) {
        printf(" ");
    }
    for (j = 1; j <= 2 * i - 1; j++) {
        printf("*");
    }
    printf("\n");
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/15J 著作权归作者所有。请勿转载和采集!