#include
#include
#include
#include
long i=1;
struct student
{
long x;
long y;
char name[10];
xuehao;
}stu[64];
void paihao();
void quhao();
void weixuehao();
void xuehaowei();
void xianshizuohao();
void main()
{ int b;
printf(“1 给你牌号,2去你牌号,3输入座号查学号,4输入学号查座号,5显示整体座号分布,e退出.”);
for(;(char)b!=’e';)
{printf(“input your choice!”);
scanf(“%d”,&b);
if(b==1) paihao();
if(b==2) quhao();
if(b==3) weixuehao();
if(b==4) xuehaowei( );
if(b==5) xianshizuohao();
}
/*for (;i<65;i++)
//{
//gets(“stu[i].name”);
//puts(“stu[i].name”);
//}*/
}
void paihao()
{ int rondomize();
int c;
struct student stu[64];
printf(“input your name\n”);
getch();
scanf(“%s”,&stu[i].name);
i++;
printf(“input your xuehao”);
scanf(“%d”,&c);
stu[i].xuehao=c;
c=random(64);
stu[i].x=c/8+1;
stu[i].y=c%8;
if(stu[i].y==0)
stu[i].y=8;
}
void quhao()
{ int a;
struct student stu[64];
printf(“in put your xuehao\n”);
scanf(“%d”,&a);
for(;stu[i].xuehao==a;)
stu[i].xuehao=000;
}
void weixuehao()
{ int d;
struct student stu[64];
int x,y;
printf(“in put your rule\n”);
scanf(“%d”,&x);
printf(“in put your lie\n”);
scanf(“%d”,&y);
for(d=1;d<=64&&!stu[i].x==x&&stu[i].y==y;d++)
{if (d>64) printf(“the num is not seted yet”);
else printf(“your xuehao is %d”,stu[i].xuehao);
}
}
void xuehaowei()
{ int a,b;
struct student stu[64];
printf(“in put your xuehao\n”);
scanf(“%d”,&a);
for(b=1;(stu[i].xuehao!=a)&&(b<=64);b++);
if (b>64) {printf(“the student is not exist!”); }
else{
printf(“xuehao\n”);
printf(“%d”,stu[i].xuehao);
printf(“hang\n”);
printf(“%d\n”,stu[i].x);
printf(“lie\n”);
printf(“%d\n”,stu[i].y);
}
}
void xianshizuohao()
{ struct student stu[64];
int b;
for(b=1;b<=64;b++)
{printf(“%4d号:学号%7d”,b,stu[b]);
if (b%8==0) printf(“\n”);
}
}
这是我刚刚编的,可能还查差的远,以后我在改进一下