c语言 打印下列图形

来源:百度知道 编辑:UC知道 时间:2024/05/31 09:26:17
打印图形
*
**
***
****
*****

c语言的!
十分着急~并且一定要对。非常感谢!!!!!
不能是那种太简单的方法吧 用循环语句

#include <stdio.h>

void main()
{
int i,j,n;
n = 5;
for(i = 0; i < n; i++)
{
for(j = 0; j < i + 1; j++)
printf("*");
printf("\n");
}

}

#include <stdio.h>
main()
{
printf("*\n**\n***\n****\n*****");
}

最简单的方法了!

#include <stdio.h>
main()
{
printf("*\n**\n***\n****\n*****");
}
佩服!太牛了。