void fan(int fan_size) {
int i,j,k,leftWing=fan_size,rightWing=0;
for(i=0;i<fan_size;i++){
rightWing++;
for(j=0;j<i;j++)
printf(" ");
for(j=fan_size;j>i;j--)
printf("*");
for(j=fan_size; j>rightWing; j--)
printf(" ");
for(j=0;j<rightWing;j++)
printf("*");
printf("\n");
}
for(i=0;i<fan_size;i++){
leftWing--;
for(k=fan_size;k>fan_size-leftWing;k--)
printf("*");
for(k=0;k<fan_size-leftWing;k++)
printf(" ");
for(j=0;j<i;j++)
printf("*");
printf("\n");
}
}
C/C++