#include<cstdio>
int n;
void P(int i,int j,int n,int f){
if(i==n){
for(int k=1;k<=n;k++)printf("*");
if(!f) puts("");
}
else if(i==1){
for(int k=1;k<=n;k++)printf("*");
if(!f){puts("");
P(i+1,1,n,f);}
else printf("*");
}
else if(i==n/8+1||i==n/4+n/8+1){
printf("*");
for(int k=2;k<n/8+1;k++)printf(" ");
for(int k=n/8+1;k<n/4+n/8+1;k++)printf("*");
for(int k=n/4+n/8+1;k<n/8+n/2+1;k++)printf(" ");
for(int k=n/8+n/2+1;k<=3*n/4+n/8;k++)printf("*");
for(int k=3*n/4+n/8+1;k<n;k++)printf(" ");
if(!f){puts("*");
// (j>n/8+1&&j<n/4+n/8||j>n/8+n/2+1&&j<n/8+3*n/4)
P(i+1,1,n,f);}
else printf("*");
}
else if(i>n/8+1&&i<n/4+n/8+1){
printf("*");
for(int k=2;k<n/8+1;k++)printf(" ");printf("*");
for(int k=n/8+2;k<n/4+n/8;k++)printf(" ");printf("*");
for(int k=n/4+n/8+1;k<n/8+n/2+1;k++)printf(" ");printf("*");
for(int k=n/8+n/2+2;k<3*n/4+n/8;k++)printf(" ");printf("*");
for(int k=3*n/4+n/8+1;k<n;k++)printf(" ");
if(!f){
puts("*");
// (j>n/8+1&&j<n/4+n/8||j>n/8+n/2+1&&j<n/8+3*n/4)
P(i+1,1,n,f);}
else printf("*");
}
// else if(i>=n/8+1&&i<=n/8+n/4+1&&(j==n/8+1||j==n/8+n/4||j==n/8+n/2+1||j==n/8+3*n/4))printf("*"),P(i,j+1,n);
else if(i==n/2+1){
printf("*");
for(int k=2;k<n/4+1;k++)printf(" ");
for(int k=n/4+1;k<=n-n/4;k++)printf("*");
for(int k=n-n/4+1;k<n;k++)printf(" ");
if(!f){puts("*");
P(i+1,1,n,f);}
else printf("*");
}
else if(i>n/2+1&&i<n){
if(n==8){
if(i==5)printf("* **** *");
else printf("* * * *");
if(!f){puts("");
P(i+1,1,n,f);}
}
//if(j>=n/4+1&&j<=n-n/4)printf("*"),P(i,j+1,n);
else {
printf("*");
for(int k=2;k<n/4+1;k++)printf(" ");
P(n-i+1,1,n/2,1);
for(int k=n-n/4+1;k<n;k++)printf(" ");
if(!f){puts("*");
P(i+1,1,n,0); }
else printf("*");
}
}
else {
printf("*");
for(int k=2;k<=n-1;k++)printf(" ");
if(!f){puts("*");
P(i+1,1,n,f);}
else printf("*");
}
return ;
}
int main(){
while(scanf("%d",&n)&&n>=8){
P(1,1,n,0);
puts("");
}
}

zoj3839-Poker Face的更多相关文章

  1. uva131 The Psychic Poker Player

    The Psychic Poker Player Time Limit: 3000MS     64bit IO Format: %lld & %llu Description In 5-ca ...

  2. UVa12298 Super Poker II(母函数 + FFT)

    题目 Source http://acm.hust.edu.cn/vjudge/problem/23590 Description I have a set of super poker cards, ...

  3. HDU 4759 Poker Shuffle

    Poker Shuffle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  4. Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 2)C. Bear and Poker

                                                  C. Bear and Poker                                     ...

  5. ZOJ 1111 Poker Hands

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1111 A poker hand consists of 5 ca ...

  6. Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 1) A. Bear and Poker 分解

    A. Bear and Poker Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/573/pro ...

  7. ZOJ1111:Poker Hands(模拟题)

    A poker deck contains 52 cards - each card has a suit which is one of clubs, diamonds, hearts, or sp ...

  8. 如何生成一副Poker

    import java.util.LinkedList;import java.util.Random;//扑克类class Poker{    String color;//花色    String ...

  9. bzoj2487: Super Poker II

    Description I have a set of super poker cards, consisting of an infinite number of cards. For each p ...

  10. One Card Poker

    qsc oj 题目 提交 比赛 小组 排名 帮助 Mactavish 题目 我的提交 One Card Poker 发布时间: 2017年2月14日 14:02   最后更新: 2017年2月14日 ...

随机推荐

  1. pm grant 命令

    CustomLocale.apk所需要的权限"android.permission.CHANGE_CONFIGURATION"自Android 4.2,4.2.2起系统定义为and ...

  2. HDOJ 2017 字符串统计

    Problem Description 对于给定的一个字符串,统计其中数字字符出现的次数. Input 输入数据有多行,第一行是一个整数n,表示测试实例的个数,后面跟着n行,每行包括一个由字母和数字组 ...

  3. 自定义UITableView的Seperator

    在默认配置中 ,UITableView的Cell之间的Seperator左边总是空出一块,即使在Storyboard中设置为0 ,也没有效果 需要在代码中进行配置,在ViewController中实现 ...

  4. [git] git 分支( branch ) 的基本使用

    分支( branches ) 是指在开发主线中分离出来,做进一步开发而不影响到原来主线. Git 存储的不是一系列的更改集( changeset ),而是一系列快照.当你执行一次 commit 时, ...

  5. 320. Generalized Abbreviation

    首先想到的是DFS,对于每个单词的字母都遍历,比如 spy: 1py,s1y,sp1 然后每个遍历完的单词再DFS..左右有数字就合并比如 1py: 11y=>2py, 1p1 这样.. 但是单 ...

  6. Java学习笔记六(I/O流)

    1.介绍 在实际开发过程中经常会用到数据的输入/输出操作,本篇博客着重分析一下,java中经经常使用到的有关IO操作的类.而在java中能够将经常使用的流分为两个部分:字节流和字符流. 1.流的抽象基 ...

  7. struts2 json 定义全局Date格式

    使用struts2的json插件时,自己定义日期格式经常使用的方式是在get属性上加入@JSON注解,这个对于少量Date属性还能够,可是假设date字段多了,总不可能去给每一个date get方法加 ...

  8. QT程序打包发布(双击运行)

  9. iOS-UIControls介绍

    iOS-UIControls类介绍 UIControl的继承关系 UIControl是 UIKit中UISwitch(开关).UIButton(按钮).UISegmentedControl(分段控件) ...

  10. linux 命令终端提示符显示-bash-4.1#解决方法

    昨天在配置linux,突然发现root登录的CRT的终端提示符显示的是-bash-4.1# 而不是root@主机名 + 路径的显示方式.搞了半天也不知道为什么出现这种情况.今天终于搞定这个问题, 原因 ...