高手进来看一下我哪里错了!!!!这是c语言问题

来源:百度知道 编辑:UC知道 时间:2024/06/01 23:35:06
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
main(){
enum colors{Spade,Heart,Diamond,Club};
enum point{Ace,King,Queen,Jack,Ten,Nine,Eight,Seven,Six,Five,Four,Three,Tow};
typedef struct
{enum colors c;
enum point p;}Card;
typedef Card suit[13];
typedef struct
{Suit cs;
enum {North,East,South,West}Pos;}Player;
typedef Player Players[4];Card sc[52];
players Table; int s[52],i,j,k;
for(i=North;i<=west;++i)Table[i],Pos=i;
randomize();
for(j=0;j<=51;++j)
{do
{sc[j].c=random(4);sc[j].p=random(13);
for(k=1,i=0;(i<j)&&k;++i)
if(sc[i].c==sc[j].c&&sc[i].p==sc[j].p)k=0;}
while(!K);}
for(i=0;i<52;++i)
{j=i%4;k=i/4;
Table[j].cs[k].c=sc[i].c;
Table[j].cs[k].p=sc[i].p;}
for(i=North;i<=West;++i)
{switch(i)
{case North:printf("North:\n");break;
case East:printf("Ea

写得好乱啊……
给你几点建议:
1.typedef 作为自定义函数应该写在#define后面main()函数上面
2.调用函数应该写在main()函数上面,或者是在main函数中先声明调用函数然后才能将其写在main()的后面(也有特例,不过为了函数的健壮性还是按规则2来写吧)
3、任何函数都是从main()开始,从main()结束
对于你写的函数,太乱,很不清晰……

兄弟你的swith没有default啊。大忌!
格式太乱。要有留空和留白。
自己改,别人看都方便。。