Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Chawin

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-08 06:45:14

// #include <stdio.h>

// int main(){
//     char n[4];
//     scanf("%s", &n);

//     char dice[7][3][5] = {
//         {
//             "    ",
//             "    ",
//             "___ "
//         },
//         {
//             "    ",
//             " *  ",
//             "    "
//         },
//         {
//             " *  ",
//             "    ",
//             " *  "
//         },
//         {
//             "*   ",
//             " *  ",
//             "  * "
//         },
//         {
//             "* * ",
//             "    ",
//             "* * "
//         },
//         {
//             "* * ",
//             " *  ",
//             "* * "
//         },
//         {
//             "* * ",
//             "* * ",
//             "* * "
//         }
//     };

//     for (int row = 0; row < 3; row++) {
//         for (int i = 0; i < 3; i++) {
//             int d = n[i] - '0';
//             if (d < 1 || d > 6) d = 0;
//             printf("%s", dice[d][row]);
//         }
//         printf("\n"); 
//     }
// }

#include <stdio.h>
int main(){
    int N;
    scanf("%d", &N);
    int a, b, c;
    a = N / 100; b = N % 100 / 10, c = N % 10;
    if (!(a >= 1 && a <= 6)) a = 0;
    if (!(b >= 1 && b <= 6)) b = 0;
    if (!(c >= 1 && c <= 6)) c = 0;
    char dice[7][3][4] = {
        {
            "   ",
            "   ",
            "___"
        },
        {
            "   ",
            " * ",
            "   "
        },
        {
            " * ",
            "   ",
            " * "
        },
        {
            "*  ",
            " * ",
            "  *"
        },
        {
            "* *",
            "   ",
            "* *"
        },
        {
            "* *",
            " * ",
            "* *"
        },
        {
            "* *",
            "* *",
            "* *"
        }
    };
    for (int i = 0; i < 3; i++) printf("%s %s %s\n", dice[a][i], dice[b][i], dice[c][i]);
}