Start: Dec, 22, 2016 18:15:00
2016年秋季学期程序设计基础第三次考试
End: Dec, 22, 2016 21:00:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 1ms
Memory: 1092kB
Author: 2016210401008
In contest: 1080

#include<stdio.h>
#include<string.h>
int main(void){
	int n;
	char s;
	while(scanf("%d %c",&n,&s)!=EOF){
		int i,j;
		for(i = 0;i < n + 4;i++){
			for(j = 0;j < 4*n + 7 ;j++){
				if((j == 2||j == n+1||j==2*n+4||j==3*n+3||j==3*n+5||j==4*n+4)&&i>=2&&i<n+2)
				printf("%c",s);
				else if(i == n/2+2&&j < n+1&&j > 2)
				printf("%c",s);
				else if(i == n+1&&j > 3*n + 5&&j < 4*n + 4)
				printf("%c",s);
				else if(j > n+2&&j <= 2*n+2&&(i == 2||i == n+1))
				printf("%c",s);
				else if(j > n+2&&j <= 2*n+2&&(i + j)==2*n+4)
				printf("%c",s);
				else if(j > 2*n+4&&j<3*n+3&&(j-i) == 2*n+2)
				printf("%c",s);
				else if((j == 0||j == 4 * n+6)&&i != 0&&i != n+3)
				printf("|");
				else if(i == 0||i == n + 3)
				printf("-");
				else
				printf(" ");
			}
			printf("\n");
		}
	}
	return 0;
}