Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: cyblox_boi

Problemset: ลูกเต๋า

Language: cpp

Time: 0.005 second

Submitted On: 2025-12-29 16:26:17

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    unordered_map<int, vector<string>> dices = {
        {1, {"   ", " * ", "   "}},
        {2, {"   ", "* *", "   "}},
        {3, {" * ", " * ", " * "}},
        {4, {"* *", "   ", "* *"}},
        {5, {"* *", " * ", "* *"}},
        {6, {"* *", "* *", "* *"}},
    };

    string number;
    cin >> number;

    try
    {
        vector<string> diceFace(3);

        for (int i = 0; i < 3; i++)
        {
            int temp = number[i] - '0';

            if (temp < 1 || temp > 6)
            {
                throw string("ERROR");
            }

            for (int j = 0; j < 3; j++)
            {
                diceFace[j] += dices[temp][j];

                if (i != 2)
                {
                    diceFace[j] += '|';
                }
            }
        }

        for (const string &dice : diceFace)
        {
            cout << dice << '\n';
        }
    }
    catch (const string &errorMessage)
    {
        cout << errorMessage << '\n';
    }

    return 0;
}