Submission

Status:

----------

Subtask/Task Score:

0/100

Score: 0

User: Krispans

Problemset: ลูกเต๋า (2566)

Language: cpp

Time: 0.005 second

Submitted On: 2026-09-25 15:31:28

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

int main(){

    string n;
    cin >> n;
    string digits[6][3][3] = {
        //1
        {{"", "" ,""},{"", "*" ,""},{"", "" ,""}},
        //2
        {{"", "*" ,""},{"", "" ,""},{"", "*" ,""}},
        //3
        {{"*", "" ,""},{"", "*" ,""},{"", "" ,"*"}},
        //4
        {{"*", "" ,"*"},{"", "" ,""},{"*", "" ,"*"}},
        //5
        {{"*", "" ,"*"},{"", "*" ,""},{"*", "" ,"*"}},
        //6
        {{"*", "" ,"*"},{"*", "" ,"*"},{"*", "" ,"*"}}
    };
    string invalid[3] = {"", "", "___"};
    for (int row = 0; row < 3; row++) {

        for (int digit = 0; digit < n.length(); digit++) {

            int x = n[digit] - '1';

            if (x >= 0 && x < 6) {

                for (int col = 0; col < 3; col++) {
                    std::cout << digits[x][row][col] << ' ';
                }

            }
            else {

                std::cout << invalid[row] << ' ';
            }
        }

    std::cout << '\n';
}
}