Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: jeeno987
Problemset: ลูกเต๋า (2566)
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-10 18:17:43
#include <iostream>
#include <string>
using namespace std;
// Faces from the statement's figure, 3 rows of 3 characters. A digit that is not 1-6 prints "___" on the last row.
const char *FACE[7][3] = {
{" ", " ", "___"},
{" ", " * ", " "},
{" * ", " ", " * "},
{"* ", " * ", " *"},
{"* *", " ", "* *"},
{"* *", " * ", "* *"},
{"* *", "* *", "* *"},
};
int main() {
string s;
cin >> s;
for (int r = 0; r < 3; r++) {
string line = "";
for (int i = 0; i < 3; i++) {
int d = s[i] - '0';
if (d < 1 || d > 6) d = 0;
if (i > 0) line += " ";
line += FACE[d][r];
}
cout << line << '\n';
}
return 0;
}