题解 | #kiki算数#
及格分数
http://www.nowcoder.com/practice/56513524333148b38945e1989bc7df4e
#include <stdio.h>
//字符金字塔
int main()
{
char a = "";
a = getchar();
int i = 0; //行数
int row = 5;
for (i = 1; i <= row; i ++) {
int j = 0; //空格数
for (j = 1; j <= row - i; j ++) {
printf(" ");
}
int k = 0; //字符数
for (k = 1; k <= i; k ++) {
printf("%c ", a);
}
printf("\n");
}
}