C语言网-打印图案

题目要求

样例输出

  *
 * *
*****

由于没有太多要求,我们直接printf输出

#include <stdio.h>
#include <stdlib.h>

int main(){
	//第一种方法
	printf("  *\n\
 * *\n\
*****\n");
	system("pause");
	//第二种方法
	printf("  *");
	printf(" * *");
	printf("*****");
}
posted @ 2025-01-01 22:09  论码  阅读(32)  评论(0)    收藏  举报