U E D R , A S I H C RSS

마름모출력/이태양

#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");
	}
	
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:24
Processing time 0.0096 sec