c语言 一个纸牌程序

一个类似盖棉被的纸牌游戏,先输入2张牌. 例如:3D是方块3, JS是梅花11.花色为 H C D S, 数值范围为23456789TJQKA. 当2张牌数字相同的时候(不计花色) ,显示SNAP, 然后结束.不相同的话就一直输入下去样本:Type in your cards:3SKHAH7C7SSNAP有给了点提示:#include <stdio.h>#include <string.h>/* variable declaration card1 card2 */int main(){/* read in starting 2 card */whlie(/* card1 rank not the same as card2 */){"shift"->strcpyget new cardprintf}类似这样,谢谢了~
2026年09月23日 15:07
有3个网友回答
网友(1):

#include
#include

char card1[5],card2[5];

int main(){;
printf("Type in your card:\n");
gets(card1);
gets(card2);

while(card1[0]!=card2[0]){
strcpy(card1,card2);
gets(card2);}

printf("snap");
}

网友(2):

你如是想要能玩的话,分太少了,要花很多心思的呢

网友(3):

3S
KH
7S
AH
7C
这样的话要不要停?