View Code of Problem 53

#include<stdio.h>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int main(){
        int n;
        scanf("%d", &n);
        for(int i=-(n-1);i<n;i++){
        	for(int j=0;j<abs(i);j++){
        		printf(" ");
			}
        	int a=2*(n-abs(i))-1;
        	for(int k=0;k<a;k++){
        		printf("*");
			}
        	printf("\n");
		}
	  return 0;
}

Double click to view unformatted code.


Back to problem 53