zoukankan      html  css  js  c++  java
  • poj1102

    模拟

    #include <iostream>
    #include <string>
    using namespace std;
    
    char numbers[10][5][3] = {
        {
            ' ', '-', ' ',
            '|', ' ', '|',
            ' ', ' ', ' ',
            '|', ' ', '|',
            ' ', '-', ' ',
        },
        {
            ' ', ' ', ' ',
            ' ', ' ', '|',
            ' ', ' ', ' ',
            ' ', ' ', '|',
            ' ', ' ', ' ',
        },
        {
            ' ', '-', ' ',
            ' ', ' ', '|',
            ' ', '-', ' ',
            '|', ' ', ' ',
            ' ', '-', ' ',
        },
        {
            ' ', '-', ' ',
            ' ', ' ', '|',
            ' ', '-', ' ',
            ' ', ' ', '|',
            ' ', '-', ' ',
        },
        {
            ' ', ' ', ' ',
            '|', ' ', '|',
            ' ', '-', ' ',
            ' ', ' ', '|',
            ' ', ' ', ' ',
        },
        {
            ' ', '-', ' ',
            '|', ' ', ' ',
            ' ', '-', ' ',
            ' ', ' ', '|',
            ' ', '-', ' ',
        },
        {
            ' ', '-', ' ',
            '|', ' ', ' ',
            ' ', '-', ' ',
            '|', ' ', '|',
            ' ', '-', ' ',
        },
        {
            ' ', '-', ' ',
            ' ', ' ', '|',
            ' ', ' ', ' ',
            ' ', ' ', '|',
            ' ', ' ', ' ',
        },
        {
            ' ', '-', ' ',
            '|', ' ', '|',
            ' ', '-', ' ',
            '|', ' ', '|',
            ' ', '-', ' ',
        },
        {
            ' ', '-', ' ',
            '|', ' ', '|',
            ' ', '-', ' ',
            ' ', ' ', '|',
            ' ', '-', ' ',
        }
    };
    int        size;
    
    void print(int line, char *se)
    {
        int        i, j;
    
        for (i = 0; i < strlen(se); i++)
        {
            cout << numbers[se[i] - '0'][line][0];
            for (j = 0; j < size; j++)
                cout << numbers[se[i] - '0'][line][1];
            cout << numbers[se[i] - '0'][line][2];
            cout << " ";
        }
        cout << endl;
    }
    
    void work()
    {
        char    se[20];
        int        i;
        
        cin >> se;
        print(0, se);
        for (i = 0; i < size; i++)
            print(1, se);
        print(2, se);
        for (i = 0; i < size; i++)
            print(3, se);
        print(4, se);
        cout << endl;
    }
    
    int main()
    {
        //freopen("t.txt", "r", stdin);
        while (cin >> size && size != 0)
            work();
        return 0;
    }
    View Code
  • 相关阅读:
    7.16,7.18练习题
    Summer training(一)
    Correct Solution?
    [欢迎来怼] 团队第一周贡献分分配结果
    欢迎来怼—选题展示
    视频展示
    美工+文案展示
    作业要求20171015贡献分分配规则
    作业要求20170928-4 每周例行报告
    作业要求20170928-3 四则运算试题生成
  • 原文地址:https://www.cnblogs.com/rainydays/p/3201443.html
Copyright © 2011-2022 走看看