Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: ChanakanStudy

Problemset: Abacus

Language: cpp

Time: 0.005 second

Submitted On: 2026-09-19 21:30:37

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

int main() {
    string n;
    int row=1;
    cin >> n;
    n = string(8-n.size(),'0') + n;

    for(int j=1;j<11;j++) {
        if(row == 4) {
            cout << "-----------------";
        }
        for (int i =0;i<n.size();i++) {
            if(row == 1) {
                cout << "*" << " ";
            }
            if(n[i] >= '5') {
                if(row == 2) {
                    cout << " " << " ";
                }
                else if(row == 3) {
                    cout << "*" << " ";
                }
            }
            else {
                if(row == 3) {
                    cout << " " << " ";
                }
                else if(row == 2) {
                    cout << "*" << " ";
                }
            }
            int temp;
            temp = abs(n[i]-'0')%5;
            if(row == temp+5) {
                cout << " " << " ";
            }
            else {
                if(row >= 5) {
                    cout << "*" << " ";
                }
            }
        }
        cout << endl;
        row++;
    }
}