Submission
Status:
-----PP---
Subtask/Task Score:
20/100
Score: 20
User: 08
Problemset: ลูกเต๋า
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-18 15:11:07
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int g;
cin >> g;
vector<int> a(3);
a[0] = g / 100;
a[1] = (g / 10) % 10;
a[2] = g % 10;
if (a[0] >= 1 && a[0] <= 6 && a[1] >= 1 && a[1] <= 6 && a[2] >= 1 && a[2] <= 6) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
cout << "|";
if (i == 0) {
if (a[j] == 1 || a[j] == 2) { cout << " |"; }
else if (a[j] == 3 ) { cout << " * |"; }
else if (a[j] == 5 || a[j] == 6 || a[j] == 4) { cout << "* *|"; }
}
else if (i == 1) {
if (a[j] == 4) { cout << " |"; }
else if (a[j] == 1 || a[j] == 3 || a[j] == 5) { cout << " * |"; }
else if (a[j] == 2 || a[j] == 6) { cout << "* *|"; }
}
else if (i == 2) {
if (a[j] == 1 || a[j] == 2) { cout << " |"; }
else if (a[j] == 3) { cout << " * |"; }
else if (a[j] == 4 || a[j] == 5 || a[j] == 6) { cout << "* *|"; }
}
}
cout << endl;
}
} else {
cout << "ERROR";
}
return 0;
}