#include<stdio.h>
void main(){
	char pattern;
	int i,j,k,b;

	printf("패턴입력:");scanf("%c",&pattern);
	printf("변입력:");scanf("%d",&b);
	
	for(i=1;i<=b;i++)
	{
		for(k=b;k>=i;k--)
			printf(" ");
		
		for(j=1;j<i+i;j++)
			printf("%c",pattern);
		
		printf("\n");
	}
	for(i=b-1;i>=1;i--)
	{
		for(k=i;k<=b;k++)
			printf(" ");
		
		for(j=i+i;j>1;j--)
			printf("%c",pattern);
		
		printf("\n");
	}
	
}

Retrieved from http://wiki.zeropage.org/wiki.php/마름모출력/이태양
last modified 2021-02-07 05:29:24