源代码
C语言之用for语句实现*符倒三角输出

#include "stdafx.h"
void main()
{ 
	int i,j;
	int munber;
	printf("请输入上层数:");
	scanf("%d",&munber);
	for(i=1;i<=munber;i++)
	{
		for(j=1;j<=i-1;j++)
			printf(" ");
		for(j=1;j<=2*(munber-i)+1;j++)
			printf("*");
		printf("\n");
	}
	for(i=1;i<munber;i++)
	{
		for(j=1;j<=munber-1-i;j++)
			printf(" ");
		for(j=1;j<=2*i+1;j++)
			printf("*");
		printf("\n");
	}
}

运行结果C语言之用for语句实现*符倒三角输出

相关文章:

  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
  • 2022-01-03
  • 2021-12-26
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2021-10-26
相关资源
相似解决方案