#include#include #define AS 12 #define S 10 struct as { int q[AS]; char w[AS]; char e[AS]; char t[AS]; }; void b(struct as* pc); void qq(void); void aa(void); void a(struct as ww[]); void c(struct as ee[]); int d(struct as* pa); void e(struct as *pb, int m); struct as qw[AS]; char q[AS] = "YES"; int j[AS]; int n = 0; int v,f; int main(void) { char x; int k = 0; int l,m; l = m =0; for (int z = 0; z w[0]) == NULL) { printf("%d ", (pc + r)->q[0]); } } printf("n"); } void a(struct as ww[]) { int a = 0; for (int r = 0; r < AS; r++) { if((ww[r].w[0])==NULL) { a++; } } printf("当前空座位数:%dn", a); } void c(struct as ee[]) { printf("座位号码:"); for (int y = 0; y < AS; y++) { printf("%d ", ee[y].q[0]); } printf("n"); } void qq(void) { printf("请输入以下选项:n"); printf("a.显示空座位数量nb.显示空座位号码nc.显示座位的号码nd.为用户分配指定座位ne.删除一个座位分配nf.退出n"); } void aa(void) { while (getchar() != 'n') { continue; } } int d(struct as* pa) { int a = 0; int b = 0; aa(); if (f == 1) { f = 0; } printf("%d", j[0]); printf("请输入你要购买的座位号:"); while ((a == j[0])||(n==1)) { if (b != 0) { printf("该票已被预定,请重新输入:"); } while ((scanf_s("%d", &a)) != 1) { printf("输入错误,请输入座位号:"); aa(); } b++; if ((b == 1) && (a == 0)&&(v==0)) { n = 1; v = 1; break; } if (a != j[0]) { n = 1; break; } } aa(); (pa + a)->w[0] = q[0]; printf("请输入订票人的名:"); gets_s((pa + a)->e, AS - 1); printf("请输入订票人的姓:"); gets_s((pa + a)->t, AS - 1); printf("订票成功n"); return a; } void e(struct as *pb, int m) { aa(); int a = 0; int b = 0; for (int t = 0; t < m; t++) { printf("已定座位号:%d ", j[t]); } printf("n"); printf("请输入你要删除的预订座位号:"); while (a != j[0]) { if (b != 0) { printf("该座位没有被预定,请重新输入:"); } while ((scanf_s("%d", &a)) != 1) { printf("请输入错误,请重新输入:"); } b++; } (pb + a)->w[0] = NULL; (pb + a)->e[AS-1] = NULL; (pb + a)->t[AS-1] = NULL; j[0] = 0; printf("删除成功n"); }



