U E D R , A S I H C RSS

마름모출력/김유정

~cpp
#include <stdio.h>
main()
{
	int column,row, star,a;
    char pattern;
	printf("패턴입력:");
		scanf("%c",&pattern);
	printf("변의 길이 입력:");
	    scanf("%d",&a);
	for(row=1; row<=a ; row=row+1)
	{
		for (column=a ; column > row ; column=column-1)
		{
			printf(" ");
		}
		for(star=0;star<2*column-1;star=star+1)
		{
			printf("*");
		}
		printf("\n");
	}		
	
	
	for (row=1;row<=a;row=row+1) {
		for(column=1;column<=row;column=column+1){
			printf(" ");
		}
        
		
		for (star=0;star<2*a-2*column+1;star=star+1) {
			printf("*");
		}
		
		printf("\n");
		
	}
	
	
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:23
Processing time 0.0170 sec