codeforces A. Bayan Bus(简单模拟)

简介:

#include <queue>
#include <string>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define N 20000
using namespace std;

int num[5][15];

int main()
{
    int n;
    cin>>n;
    for(int j=1; j<=11 && n; ++j){
        for(int i=1; i<=4; ++i){
            if(j>1 && i==3) continue;
            --n;
            num[i][j] = 1;
            if(n == 0) break;
        }
    } 

    printf("+------------------------+\n");
    for(int i = 1; i<=4; ++i){
        printf("|");
        for(int j=1; j<=11; ++j){
            if(num[i][j]) printf("O.");
            else{
                if( i != 3 || (i==3 && j==1))
                    printf("#.");
                else printf("..");
            }
        }
        if(i == 1) printf("|D|)\n");
        if(i==2) printf("|.|\n");
        if(i==3) printf("..|\n");
        if(i==4) printf("|.|)\n");
    }
    printf("+------------------------+\n");
    return 0;
}

目录
相关文章
|
机器人
hdu1035 Robot Motion(简单模拟题)
hdu1035 Robot Motion(简单模拟题)
38 0
Shortest Path with Obstacle( CodeForces - 1547A )(模拟)
Shortest Path with Obstacle( CodeForces - 1547A )(模拟)
49 0
|
机器学习/深度学习 人工智能 BI
The Great Hero(Codeforces Round #700 (Div. 2))模拟+贪心思想和排序
The Great Hero(Codeforces Round #700 (Div. 2))模拟+贪心思想和排序
60 0
|
人工智能 算法
Codeforces #737Div2A. A. Ezzat and Two Subsequences(模拟)
Codeforces #737Div2A. A. Ezzat and Two Subsequences(模拟)
47 0
Codeforces1486 C2.Guessing the Greatest (hard version)(交互题+奇怪的二分)
Codeforces1486 C2.Guessing the Greatest (hard version)(交互题+奇怪的二分)
46 0
|
人工智能 Java
[HDU 7136] Jumping Monkey | 并查集 | 逆向思维
Jumping Monkey Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 747 Accepted Submission(s): 360
221 0
[HDU 7136] Jumping Monkey | 并查集 | 逆向思维
HDU-1690,Bus System(弗洛伊德)
HDU-1690,Bus System(弗洛伊德)
HDOJ 1339 A Simple Task(简单数学题,暴力)
HDOJ 1339 A Simple Task(简单数学题,暴力)
113 0