Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: UNJE0o

Problemset: Abacus

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-13 11:02:13

#include <iostream>
using namespace std;
#define en '\n'
typedef long long ll;

int main(){
    char top[3][8] = {
        {'*','*','*','*','*','*','*','*'},
        {'*','*','*','*','*','*','*','*'},
        {' ',' ',' ',' ',' ',' ',' ',' '}
    },

    under[6][8] = {
        {' ',' ',' ',' ',' ',' ',' ',' '},
        {'*','*','*','*','*','*','*','*'},
        {'*','*','*','*','*','*','*','*'},
        {'*','*','*','*','*','*','*','*'},
        {'*','*','*','*','*','*','*','*'},
        {'*','*','*','*','*','*','*','*'},
    };


    string n = "",N;cin >> N;
    int len = N.size();
    for(int i = len-1;i>=0;i--)n+=N[i];
    // cout << n << en;
    for(int i =0;i < n.size();i++){
       if(n[i] == '1'){
            // if(n[i-1] == '0' && i-1 >= 0){
            //     top[0][i-1] = ' ';
            //     top[2][i-1] = '*';
            // } else {
            //     under[0][i] = '*';
            //     under[1][i] = ' ';
            // }
            under[0][i] = '*';
            under[1][i] = ' ';
       }

       else if(n[i] == '2'){
            under[0][i] = '*';
            under[2][i] = ' '; 
       }

       else if(n[i] == '3'){
            under[0][i] = '*';
            under[3][i] = ' '; 
       }

       else if(n[i] == '4'){
            under[0][i] = '*';
            under[4][i] = ' '; 
       }

       else if(n[i] == '5'){
            top[1][i] = ' ';
            top[2][i] = '*'; 
       }

       else if(n[i] == '6'){
            top[1][i] = ' ';
            top[2][i] = '*';

            under[0][i] = '*';
            under[1][i] = ' ';
       }

       else if(n[i] == '7'){
            top[1][i] = ' ';
            top[2][i] = '*';

            under[0][i] = '*';
            under[2][i] = ' ';
       }

       else if(n[i] == '8'){
            top[1][i] = ' ';
            top[2][i] = '*';

            under[0][i] = '*';
            under[3][i] = ' ';
       }

       else if(n[i] == '9'){
            top[1][i] = ' ';
            top[2][i] = '*';

            under[0][i] = '*';
            under[4][i] = ' ';
       }
    }

    for(int i = 0;i < 3;i++){
        for(int j = 7;j >= 0;j--){
            cout << top[i][j] << " ";
        } cout << en;
    }

    for(int i = 0;i < 17;i++) cout << "-";
    cout << en;
    for(int i = 0;i < 6;i++){
        for(int j = 7;j >= 0;j--){
            cout << under[i][j] << " ";
        } cout << en;
    }
}