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
  • 相关阅读:
    前端工程师们,这些干货让你开发效率加倍
    我的代码片段
    人生至少有一次为了自己的勇气而活
    美食篇之御桥小聚
    美食篇之好好对自己
    F
    Github 简明教程
    A
    完美字符串
    1222: FJ的字符串 [水题]
  • 原文地址:https://www.cnblogs.com/rainydays/p/3201443.html
Copyright © 2011-2022 走看看