Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Prima

Problemset: Abacus

Language: cpp

Time: 0.002 second

Submitted On: 2026-08-04 21:11:22

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

int main(){
    string s;
    cin >> s;

    while(s.length()<8){
        s="0"+s;
    }

    char arr[10][17];
    for(int r=0; r<10; r++){
        for(int c=0; c<17; c++){
            arr[r][c]= ' ';
        }
    }

    for(int col=0; col<8; col++){
        int d =s[col] -'0';
        int pos = col*2;
        arr[0][pos]= '*';
        arr[1][pos]= '*';
        if(d>=5){
            arr[1][pos]=' ';
            arr[2][pos]='*';
        }
        int lower = d % 5;

    for(int i=0; i<6; i++){
        if(i == lower)
            arr[4 + i][pos] = ' ';
        else
            arr[4 + i][pos] = '*';
    }
    }
    for(int j=0; j<17; j++){
        arr[3][j] = '-';
    }
    
    for(int r=0; r<10; r++){
        for(int c=0; c<17; c++){
            cout << arr[r][c];
        }
        cout << '\n';
    }
return 0;
}