#include <stdio.h> #include<math.h> int main(void) { int n,i,j; printf("input n:\n"); scanf("%d",&n); n/=2; for(i=-n;i<=n;++i) { for(j=0;j<=abs(i);++j) printf(" "); for(j=0;j<abs(-n-(i<0?i:-i))*2+1;++j) printf("*"); printf("\n"); } return 0; }