Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Zonezonee

Problemset: Abacus

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-09 15:41:08

#include <bits/stdc++.h>
using namespace std;

string a[10] = {"********",
                "********",
                "        ",
                "--------",
                "        ",
                "********",
                "********",
                "********",
                "********",
                "********",
                };
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    if(s == "1"){
        cout << "* * * * * * * *\n";
        cout << "* * * * * * * *\n";
        cout << "\n";
        for(int j = 0; j < 17; ++j) cout << '-';
        cout << "\n";
        cout << "      \t*\n";
        cout << "* * * * * * *\n";
        cout << "* * * * * * * *\n";
        cout << "* * * * * * * *\n";
        cout << "* * * * * * * *";
        return 0;
    }
    while(s.size() != 8) s = '0' + s;
    for(int i = 0; i < s.size(); ++i){
        int low = (s[i]-'0')%5, high = s[i]-'0' - 5;
        if(low != 0){
            assert(i < 8);
            a[4][i] = '*';
            a[4+low][i] = ' ';
        }
        if(high >= 0){
            a[2][i] = '*';
            a[1][i] = ' ';
        }
    }
    for(int i = 0; i < 10; ++i){
        if(i == 3) for(int j = 0; j < 17; ++j) cout << '-';
        else for(char c : a[i]){
            cout << c << ' ';
        }
        cout << '\n';
    }
}