Home > Back-end >  For help
For help

Time:10-19

In A poker game, different CARDS represent different values, with the number 3-10 CARDS, value for itself, the value of J for 11, Q is 12, K to 13 to 14, A card with the number 2 values for 15, the first line of input for the number of CARDS will be sent to you, the second line of input for you receive the flapping
G card (separated with a space between), the third line of input for the requirement of the number of CARDS, please by calculation,
Output numerical the biggest poker you can play the combination (according to the numerical) since the childhood, and output
Their total value
Input:
5
2, 3, 6 and 9 K
3
Output:
9 K 2
37 for help with c
This is my error code
#include
Int main ()
{
Int x, I, n, m, j, t;
Int a [13]={3,4,5,6,7,8,9,10,11,12,13,14};
Char b [100];
The scanf (" % d ", & amp; n);
The scanf (" % s ", & amp; b);
The scanf (" % d ", & amp; M);
for(i=0; i{
If (b [I]=='J') [I]=b;
If (b [I]=='Q') b [I]=12;
If (b [I]=='K') [I]=b;
If (b [I]=='A') [I]=b;
If (b [I]=='2') [I]=b;
}
for(j=0; J{
for(i=0; i{
If (b [I] & gt; B [I + 1])
{
T=b [I];
B=b [I] [I + 1);
B [I + 1]=t;
}
}

}
for(i=0; i{
If [I]==11 (b) b [I]='J';
If [I]==12 (b) b [I]='Q';
If [I]==13 (b) b [I]='K';
If [I]==14 (b) b [I]='A';
If (b [I]==15) b [I]='2';
}
For (n. N>=n - m; N -)
{
Printf (" % 2 d "[n]. B);
}
For (n. N>=n=m; N -)
{
X=x + b [n].
}

return 0;
}

CodePudding user response:

Your problem

CodePudding user response:

Can you help me with this problem
  • Related