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
  • 相关阅读:
    004-基于统计的翻译系统
    003-LDA
    002-01朴素贝叶斯到语言模型
    001-NLP基础
    11-word2vec
    009-TensorFlow-GPU版本安装
    008-TensorFlow的模型保存于加载
    007-RNN和LSTM
    006-卷积神经网络
    《笨方法学python》随笔
  • 原文地址:https://www.cnblogs.com/rainydays/p/3201443.html
Copyright © 2011-2022 走看看