View Code of Problem 53

#include<cstdio>
int main(){
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		int j=n-i;
		while(j--)	printf(" ");
		for(int k=2*i-1;k>0;k--){
			printf("*");
		}
		printf("\n");
	}
	for(int i=n-1;i>0;i--){
		int j=n-i;
		while(j--)	printf(" ");
		for(int k=2*i-1;k>0;k--){
			printf("*");
		}
		printf("\n");				
	}
	
	return 0;
} 

Double click to view unformatted code.


Back to problem 53