c语言考试排座位系统源程序,谁能帮忙用tc写一个 排考场座位系统?谢谢!

#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”);

}

}

这是我刚刚编的,可能还查差的远,以后我在改进一下

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值