Submission

Status:

PPPPPxxPPP

Subtask/Task Score:

80/100

Score: 80

User: kenkong587

Problemset: ลูกเต๋า

Language: c

Time: 0.002 second

Submitted On: 2026-10-02 16:34:22

#include <stdio.h>

int main(){

    int num;

    scanf("%d",&num);

    int n1 = (num / 100)-1;
    int n2 = ((num % 100) / 10)-1;
    int n3 = (num % 10)-1;

    if(n1 + 1 > 6 || n2 + 1 > 6 || n3 + 1 > 6){
        printf("ERROR");
        return 1;
    }

    char c1[6][4] = {"   ",
                     "   ",
                     " * ",
                     "* *",
                     "* *",
                     "* *"};
    char c2[6][4] = {" * ",
                     "* *",
                     " * ",
                     "   ",
                     " * ",
                     "* *"};
    char c3[6][4] = {"   ",
                     "   ",
                     " * ",
                     "* *",
                     "* *",
                     "* *"};

    printf("%s",c1[n1]);
    printf("|");
    printf("%s",c1[n2]);
    printf("|");
    printf("%s",c1[n3]);
    printf("\n");
    printf("%s",c2[n1]);
    printf("|");
    printf("%s",c2[n2]);
    printf("|");
    printf("%s",c2[n3]);
    printf("\n");
    printf("%s",c3[n1]);
    printf("|");
    printf("%s",c3[n2]);
    printf("|");
    printf("%s",c3[n3]);

    return 0;
}