圣诞树代码🌲🌲🌲

98 阅读1分钟
#include <stdio.h>
#include <windows.h>

int main(){
	int i,j,k,m,n=16,h=1;
	char a='*';
	for(m=1;m<=4;m++){
		for(i=1;i<=4;i++){
			for(k=1;k<=n-2*h;k++){
				printf(" ");
			}
			for(j=3;j<4*h;j++){
				system("color 2");
				printf("%c", a);
			}
			printf("\n");
			h++;
		}
		h-=3;
	}
	for(i=1;i<=5;i++){
		for(k=1;k<=12;k++){
			printf(" ");
		}
		for(j=1;j<=5;j++){
			system("color 6");
			printf("%c", a);
		}
		printf("\n");
	}
	printf("\n");
	printf("  Merry Christmas!!!\n");
	return 0;
}