Getting the output to be correct
My output for the code is this
Clubs : 1 0 0 0 0 1 0 1 0 0 2 0 1
Diamonds : 0 2 1 1 1 0 0 0 0 0 0 0 0
Hearts : 1 2 0 1 1 0 0 0 0 3 0 0 1
Spades : 1 1 2 1 0 1 0 0 0 0 1 1 0
However, I want the output to look like this:
Clubs: 1 0 0 0 0 1 0 1 0 0 2 0 1
Diamonds: 0 2 1 1 1 0 0 0 0 0 0 0 0
Hearts: 1 2 0 1 1 0 0 0 0 3 0 1 1
Spades: 1 1 2 1 0 1 0 0 0 0 1 1 0
In other words, I want it so the numbers line up. However, I can't get my
code to do it. Here's my code:
for (int s=0; s < 4; s++)
{
cout << left << setw(2) << suit[s] << ": ";
for (int t=0; t <13; t++)
{
cout << right << setw(2) << deck[s][t];
if (t==12)
cout <<endl;
}
}
No comments:
Post a Comment