Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: bestisyis...programming
Problemset: ลูกเต๋า (2566)
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-07 15:07:16
#include <iostream>
#include <string>
using namespace std;
int main(){
//cin >> num; no
string dice[6][3];
dice[0][0] = " ";
dice[0][1] = " * ";
dice[0][2] = " ";
dice[1][0] = " * ";
dice[1][1] = " ";
dice[1][2] = " * ";
dice[2][0] = "* ";
dice[2][1] = " * ";
dice[2][2] = " *";
dice[3][0] = "* *";
dice[3][1] = " ";
dice[3][2] = "* *";
dice[4][0] = "* *";
dice[4][1] = " * ";
dice[4][2] = "* *";
dice[5][0] = "* *";
dice[5][1] = "* *";
dice[5][2] = "* *";
int num,unit,tenth,hundredth;
cin >> num;
unit = num%10;
num = num/10;
tenth = num%10;
num = num/10;
hundredth = num;
for(int i=0;i<3;i++){
if(hundredth>=1 && hundredth<=6) cout << dice[hundredth-1][i] << ' ';
else if(i==2) cout << "___ ";
else cout << " ";
if(tenth>=1 && tenth<=6) cout << dice[tenth-1][i] << ' ';
else if(i==2) cout << "___ ";
else cout << " ";
if(unit>=1 && unit<=6) cout << dice[unit-1][i] << ' ';
else if(i==2) cout << "___ ";
else cout << " ";
cout << endl;
}
return 0;
}