Submission
Status:
P-P-PP-P-P
Subtask/Task Score:
60/100
Score: 60
User: peilin
Problemset: ลูกเต๋า
Language: c
Time: 0.002 second
Submitted On: 2025-10-12 14:52:49
#include <stdio.h>
#include <string.h>
char dice[7][3][4] = {
{},
{" ", " * ", " "},
{"* ", " ", " *"},
{" * ", " * ", " * "},
{"* *", " ", "* *"},
{"* *", " * ", "* *"},
{"* *", "* *", "* *"}
};
int main() {
char input[4];
scanf("%3s", input);
for(int i = 0; i < 3; i++) {
for(int j = 0; j < strlen(input); j++) {
int num = input[j] - '0';
if(num < 1 || num > 6) {
printf("ERROR\n");
return 0;
}
printf("%s", dice[num][i]);
if(j < 2) printf("|");
}
printf("\n");
}
return 0;
}