https://www.acmicpc.net/problem/10996
#include<stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
int n;
scanf("%d",&n);
int f=0;
if(n==1) printf("*");
else{
for(int i=1;i<=2*n;i++){
for(int j=1;j<=n/2;j++){
if(i%2==1&&n%2==0){
if(f==0){
printf("*");
f++;
}
if(j<n/2) printf(" *");
}
else if(i%2==1&&n%2==1){
if(f==0){
printf("*");
f++;
}
printf(" *");
}
else{
printf(" *");
}
}
f=0;
printf("\n");
}
}
}