Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: SushiCodelnw

Problemset: Abacus

Language: cpp

Time: 0.002 second

Submitted On: 2025-09-26 09:37:48

#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int n, arr[8] = {0}, a[8] = {0};
    cin >> n;

    for (int i = 0; i < 8; i++) {
        int p = pow(10, 7 - i);
        if (n - p >= 0) {
            arr[i] = n / p;
            n %= p;
        }
    }

    // raw 1
    cout << "* * * * * * * * \n";

    // raw 2 - 3
    for (int i = 0; i < 2; i++) {
        string s = (i == 0) ? "  " : "* ";
        string e = (i == 0) ? "* " : "  ";

        for (int j = 0; j < 8; j++) {
            if (arr[j] >= 5) {
                if (i == 1) arr[j] -= 5;
                cout << s;
            } else cout << e;
        }
        cout << endl;
    }

    // raw 4
    cout << "-----------------\n";
    for (int i = 0; i < 8; i++) a[i] = arr[i];

    // raw 5 - 10
    for (int i = 0; i < 6; i++) {
        for (int j = 0; j < 8; j++) {
            if (arr[j] == i) cout << "  ";
            else cout << "* ";
        }
        cout << endl;
    }



    return 0;
}