#include <stdio.h> int main(void) { char a; int b; int c; int d; int e; scanf("%c", &a); for (b = 5, c = 1; c <= b; c++) { for (d = 5 - c; d > 0; d--) printf(" "); for (e = 1; e <= c; e++) printf("%c ", a); printf("\n"); } return 0; }
以上为解题
我的思路是使用嵌套循环来进行解答
c语言小白 勿喷