Submission
Status:
PPPPPPPPPP
Score: 100
User: foldnut
Problemset: ลูกเต๋า
Language: c
Time: 0.001 second
Submitted On: 2024-09-26 13:45:29
#include<stdio.h>
#include<math.h>
#include<string.h>
void main(){
char b1[6][3] = {" "," "," * ","* *","* *","* *"};
char b2[6][3] = {" * ","* *"," * "," "," * ","* *"};
char b3[6][3] = {" "," "," * ","* *","* *","* *"};
char numf[3];
int o,t,th;
scanf("%s",numf);
o = numf[0]-48;
t = numf[1]-48;
th = numf[2]-48;
if((o<=0||o>6)||(t<=0||t>6)||(th<=0||th>6)){
printf("ERROR");
}
else{
for(int i =0;i<3;i++){
printf("%c",b1[o-1][i]);
}
printf("|");
for(int i =0;i<3;i++){
printf("%c",b1[t-1][i]);
}
printf("|");
for(int i =0;i<3;i++){
printf("%c",b1[th-1][i]);
}
printf("\n");
for(int i =0;i<3;i++){
printf("%c",b2[o-1][i]);
}
printf("|");
for(int i =0;i<3;i++){
printf("%c",b2[t-1][i]);
}
printf("|");
for(int i =0;i<3;i++){
printf("%c",b2[th-1][i]);
}
printf("\n");
for(int i =0;i<3;i++){
printf("%c",b3[o-1][i]);
}
printf("|");
for(int i =0;i<3;i++){
printf("%c",b3[t-1][i]);
}
printf("|");
for(int i =0;i<3;i++){
printf("%c",b3[th-1][i]);
}
}
}