Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: eippy
Problemset: ลูกเต๋า (2566)
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-13 23:02:20
#include<iostream>
using namespace std;
int main(){
int arr[4]={0},n,l=2;
cin >> n;
while (n>0){
arr[l--] = n%10;
n /= 10;
}
char pattern[8][3][3] = {
{{' ',' ',' '},
{' ','*',' '},
{' ',' ',' '}},
{{' ','*',' '},
{' ',' ',' '},
{' ','*',' '}},
{{'*',' ',' '},
{' ','*',' '},
{' ',' ','*'}},
{{'*',' ','*'},
{' ',' ',' '},
{'*',' ','*'}},
{{'*',' ','*'},
{' ','*',' '},
{'*',' ','*'}},
{{'*',' ','*'},
{'*',' ','*'},
{'*',' ','*'}},
{{' ',' ',' '},
{' ',' ',' '},
{'_','_','_'}},
};
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
int k = arr[j]-1;
if (k >= 0 && k < 6){
for (int m=0; m<3; m++){
cout << pattern[k][i][m];
}
} else {
for (int m=0; m<3; m++){
cout << pattern[6][i][m];
}
}
cout << " ";
}
cout << endl;
}
return 0;
}