Submission

Status:

--------------------

Subtask/Task Score:

0/100

Score: 0

User: meraki

Problemset: Abacus

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-04 12:13:57

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

int main() {
    int n; cin >> n;
    cout << "* * * * * * * " << "\n";
    int a, b, c, d, e, f, g;
    a = n%10; b = n/10%10; c = n/100%10; d = n/1000%10; e = n/10000%10; f = n/100000%10; g = n/1000000%10;
    if (g >= 5) {
        cout << " ";
    } else cout << "* ";
    if (f >= 5) {
        cout << "  ";
    } else cout << "* ";
    if (e >= 5) {
        cout << "  ";
    } else cout << "* ";
    if (d >= 5) {
        cout << "  ";
    } else cout << "* ";
    if (c >= 5) {
        cout << "  ";
    } else cout << "* ";
    if (b >= 5) {
        cout << "  ";
    } else cout << "* ";
    if (a >= 5) {
        cout << " ";
    } else cout << "*";

    cout << "\n";

    if (g >= 5) {
        cout << "* ";
    } else cout << "  ";
    if (f >= 5) {
        cout << "* ";
    } else cout << "  ";
    if (e >= 5) {
        cout << "* ";
    } else cout << "  ";
    if (d >= 5) {
        cout << "* ";
    } else cout << "  ";
    if (c >= 5) {
        cout << "* ";
    } else cout << "  ";
    if (b >= 5) {
        cout << "* ";
    } else cout << "  ";
    if (a >= 5) {
        cout << "*";
    } else cout << " ";

    cout << "\n";
    cout << "-----------------";
    cout << "\n";

    int idx1 = a%5, idx2 = b%5, idx3 = c%5, idx4 = d%5, idx5 = e%5, idx6 = f%5, idx7 = g%5;

    for (int i=0; i<6; i++) {
        if (idx7 == i) {
            cout << "  ";
        } else cout << "* ";
        if (idx6 == i) {
            cout << "  ";
        } else cout << "* ";
        if (idx5 == i) {
            cout << "  ";
        } else cout << "* ";
        if (idx4 == i) {
            cout << "  ";
        } else cout << "* ";
        if (idx3 == i) {
            cout << "  ";
        } else cout << "* ";
        if (idx2 == i) {
            cout << "  ";
        } else cout << "* ";
        if (idx1 == i) {
            cout << " ";
        } else cout << "*";
        cout << "\n";
    }


}