Submission

Status:
--------------------

Score: 0

User: Phat12

Problemset: Abacus

Language: cpp

Time: 0.003 second

Submitted On: 2025-03-25 20:22:14

#include<bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define fastio ios_base::sync_with_stdio(false);cin.tie(nullptr)
using namespace std;
int top[8],down[8];
int main(){
    fastio;
    int a;
    cin >> a;
    int digits = log2(a);
    int cnt = 7;
    while (a){
        top[cnt] = (a%10)/5;
        down[cnt] = (a%10)%5;
        cnt--;
        a/=10;
    }
    cout << "* * * * * * * *\n";
    string b;
    for (int i =0;i<8;i++){
        if (!top[i]) b += "* ";
        else b += "  ";
    }
    cout << b << '\n';
    b= "";
    for (int i =0;i<8;i++){
        if (top[i]) b += "* ";
        else b += "  ";
    }
    cout << b << "\n-----------------\n";
    for (int j=0;j<5;j++){
        string b;
        for (int i=0;i<8;i++){
            if (down[i]--) b+= "* ";
            else b += "  ";
        }
        cout << b << '\n';
    }
    return 0;
}