Submission

Status:

PP--PP--P-

Subtask/Task Score:

50/100

Score: 50

User: eippy

Problemset: ลูกเต๋า (2566)

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 22:56:43

#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;
            for (int m=0; m<3; m++){
                if (k < 6){
                    cout << pattern[k][i][m];
                } else {
                    cout << pattern[6][i][m];
                }
            }
            cout << " ";
        }
        cout << endl;
    }
    return 0;
}