Home > Back-end >  How do you write this??
How do you write this??

Time:09-19

Description
Jin playing CARDS, when the opposite hand card number greater than or equal to 10 zhang, he will watch the other person's facial expression, if the other party nervous, he went out of the "Fried", if the other party in the laugh, what he is not,

Characters' J 'expression of the other party to apply for tension,' H 'each other's smiling expression, jin "Fried", then output "Z", if what doesn't make the card, print "pass",

When the opposite hand card number less than 10, he will "meet" each other out, namely each other out of the "single", he is out of the "single", the other out of the "double", he is also a double,

Characters' D 'on behalf of the other party out of the "single",' S 'on behalf of the other party out of the "double", jin "single", the output is "D", if the "double", then output "S",









Enter
Three parameters, representing the other hand card number, the other party, the other card, separated by a space between
O
Jin play
the condition of theThe sample input
Sample 1:
15 H D

Example 2:
9 J S
Sample output
Sample 1:
Pass

Example 2:
S

CodePudding user response:

Enter
Three parameters, representing the other hand card number, the other party, the other card, separated by a space between
-- -- -- -- -- --
 printf (" please enter the three parameters, representing the other hand card number, the other party, the other out of CARDS, the middle separated by a space: \ n "); 
The scanf get three parameters;
If (number of sheets & gt;=10)
{
The switch (expression)
{
Case 'J' :
The "Fried";
break;
Case 'H' :
Output "pass"
break;
Default:
break;
}
}
The else
{
If (the other side of card is odd)
The "single";
The else
The "double";
}

CodePudding user response:

The sample input
Sample 1:
15 H D

Didn't look, the other side of card is' D 'or' S ', then the
The else
{
Direct output each other out of the brand;
}
It is ok
  • Related