Submission
Status:
PP--PPP-P-
Subtask/Task Score:
60/100
Score: 60
User: bestisyis...programming
Problemset: ลูกเต๋า
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-08 23:21:56
#include <iostream>
using namespace std;
string dice[6][3];//needs to be global for function to know becasue it is different scope
void draw(int hd,int t,int u,int r){
cout << dice[hd-1][r] << "|" <<dice[t-1][r] << "|" << dice[u-1][r] << endl;
}
int main(){
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;
hundredth = num/10;
if(hundredth<=6 && hundredth>=1 && tenth<=6 && tenth>=1 && unit<=6 && unit >=1){
draw(hundredth,tenth,unit,0);
draw(hundredth,tenth,unit,1);
draw(hundredth,tenth,unit,2);
}
else cout << "ERROR";
return 0;
}