Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: tha_smith
Problemset: ลูกเต๋า
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-02 21:54:57
#include <iostream>
#include <string>
using namespace std;
int main() {
string dice[6][3] = {
{
" ",
" * ",
" ",
},
{
" ",
"* *",
" ",
},
{
" * ",
" * ",
" * ",
},
{
"* *",
" ",
"* *",
},
{
"* *",
" * ",
"* *",
},
{
"* *",
"* *",
"* *",
},
};
int n;
cin >> n;
int a = (n/100)-1;
int b = ((n%100)/10)-1;
int c = (n%10)-1;
if((a>=0 && a<=5) && (b>=0 && b<=5) && (c>=0 && c<=5)) {
cout << dice[a][0] << "|" << dice[b][0] << "|" << dice[c][0] << endl;
cout << dice[a][1] << "|" << dice[b][1] << "|" << dice[c][1] << endl;
cout << dice[a][2] << "|" << dice[b][2] << "|" << dice[c][2] << endl;
}
else {
cout << "ERROR";
}
}