Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: polikanta

Problemset: ลูกเต๋า

Language: cpp

Time: 0.002 second

Submitted On: 2026-08-15 20:15:55

#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);

    int a = n/100;
    int b = (n/10) % 10;
    int c = n % 10;

    if (a < 1 || a > 6 || b < 1 || b > 6 || c < 1 || c > 6){
        printf("ERROR");
        return 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]);
    }
    
    return 0;
}