我需要一些帮助,我一直在努力让这段代码工作,但我一生都无法弄清楚我做错了什么请帮助基本上我要做的就是模拟一副纸牌。我知道除了让这些面孔匹配之外,我基本上必须为所有事情做些什么。并让程序运行。我已经绞尽脑汁好几天了,我需要帮助。请帮我
#include <stdio.h>
#include<string.h>
enum faces{Ace = 0, Jack = 10, Queen, King};
char * facecheck(int d);
int main()
{
int deck[52], i, n;
char suits[4][9] =
{
"Hearts",
"Diamonds",
"Clubs",
"Spades"};
n = 0;
for(i = 0; i<52; i++)
{
deck[i] = n;
n++;
};
for(i=0; i<52; i++)
{
printf("%2d of %s \n", i%13, suits[i/13]);
if(i%13 == 0 || i%13 == 10 || i%13 == 11 || i%13 == 12)
printf("%s \n ", facecheck(i) );
};
return 0;
}
char * facecheck(int d)
{
static char * face[] =
{
"Ace",
"Jack",
"Queen",
"King" };
if(d == Ace)
return face[0];
else
{
if(d == Jack)
return face[1];
else
{
if(d == Queen)
return face[2];
else
{
if(d == King)
return face[3];
}
}
}
}