Submission
Status:
xxxxxxxxxx
Subtask/Task Score:
0/100
Score: 0
User: kkxkkx001
Problemset: ลูกเต๋า (2566)
Language: cpp
Time: 0.005 second
Submitted On: 2026-10-07 11:41:05
#include <iostream>
#include <string>
using namespace std;
string a[3][9]={{" "," "," "," "," "," "," "," "," "},
{" "," "," "," "," "," "," "," "," "},
{" "," "," "," "," "," "," "," "," "}};
int dice(int n, int c){
if (n >0 && n <7){
if (n==1){
a[1][1+(c*3)]="*";
}
else if (n==2){
a[0][1+(c*3)]="*";
a[2][1+(c*3)]="*";
}
else if (n==3){
a[0][(c*3)]="*";
a[1][1+(c*3)]="*";
a[2][2+(c*3)]="*";
}
else if (n==4){
a[0][(c*3)]="*";
a[2][(c*3)]="*";
a[0][2+(c*3)]="*";
a[2][2+(c*3)]="*";
}
else if (n==5){
a[0][(c*3)]="*";
a[2][(c*3)]="*";
a[0][2+(c*3)]="*";
a[2][2+(c*3)]="*";
a[1][1+(c*3)]="*";
}
else if (n==6){
a[0][(c*3)]="*";
a[2][(c*3)]="*";
a[1][(c*3)]="*";
a[1][2+(c*3)]="*";
a[0][2+(c*3)]="*";
a[2][2+(c*3)]="*";
}
}
else {
if (c==0){
a[2][0]="_";
a[2][1]="_";
a[2][2]="_";
}
else if(c==1){
a[2][3]="_";
a[2][4]="_";
a[2][5]="_";
}
else if(c==2){
a[2][6]="_";
a[2][7]="_";
a[2][8]="_";
}
}
}
int main(){
int num;
cin >> num;
int num1,num2,num3;
num1 = (num%1000)/100;
num2 = (num%100)/10;
num3 = num%10;
dice(num1,0);
dice(num2,1);
dice(num3,2);
for (int k=0;k<3;k++){
for (int i=0;i<9;i++){
if (i%3==0){
cout <<" ";
}
cout <<a[k][i];
}
cout << endl;
}
}