c语言循环语句打印如下图形: ********A *******BB ******CCC *****DDDD
时间: 2023-11-25 22:05:40 浏览: 76
C语言程序设计-编写程序打印*菱形 * *** ***** *******
```c
#include <stdio.h>
int main() {
int n = 4;
char c = 'A';
for (int i = 1; i <= n; i++) {
for (int j = n; j > i; j--) {
printf(" ");
}
for (int k = 1; k <= i; k++) {
printf("*");
}
printf("%c", c);
c++;
printf("\n");
}
return 0;
}
```
阅读全文