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
  • 相关阅读:
    笔记56 Mybatis快速入门(七)
    笔记55 Mybatis快速入门(六)
    笔记54 Mybatis快速入门(五)
    笔记53 Mybatis快速入门(四)
    笔记52 Mybatis快速入门(三)
    笔记51 Mybatis快速入门(二)
    笔记50 Mybatis快速入门(一)
    笔记49 在Spittr应用中整合Hibernate
    198. House Robber,213. House Robber II
    303. Range Sum Query
  • 原文地址:https://www.cnblogs.com/rainydays/p/3201443.html
Copyright © 2011-2022 走看看