Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: loop

Problemset: ลูกเต๋า

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-10 18:30:19

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

// Faces from the statement's figure, 3 characters wide; dice are separated by '|'. Any digit not 1-6 -> ERROR.
const char *FACE[7][3] = {
    {"", "", ""},
    {"   ", " * ", "   "},
    {"   ", "* *", "   "},
    {" * ", " * ", " * "},
    {"* *", "   ", "* *"},
    {"* *", " * ", "* *"},
    {"* *", "* *", "* *"},
};

int main() {
    string s;
    cin >> s;
    for (int i = 0; i < 3; i++)
        if (i >= (int)s.size() || s[i] < '1' || s[i] > '6') { cout << "ERROR" << '\n'; return 0; }
    for (int r = 0; r < 3; r++) {
        string line = "";
        for (int i = 0; i < 3; i++) {
            if (i > 0) line += "|";
            line += FACE[s[i] - '0'][r];
        }
        cout << line << '\n';
    }
    return 0;
}