高分悬赏!!!谁会用c++编写一个 排考场座位系统 啊!!!

来源:百度知道 编辑:UC知道 时间:2024/09/23 09:26:26
功能要求:假设考场有8×8的座位,本程序可自动对考生进行座位安排,每当一个考生进入考场就为他安排座位。
循环显示如下图所示的主菜单:
选择1,为新来的考生安排座位,其方法是:用户输入准考证号和姓名,然后系统随机产生该考生座位的行号和列号,要求做到一个考生只有一个座位,而且在已有考生的位置上不能再安排新的考生;
选择2,取消某人考场座位;
选择3,要求输入座位的行号和列号,然后显示该座位学生的信息;
选择4,要求输入某考生准考证号,然后显示该学生的座位;
选择5,显示考场座次表,要求再每个座位对应的行列上显示该考生的准考证号。

为了学习编程,我硬是写了一遍。经过运行调试,已基本无大碍!

#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

/********************************************/
class student
{
public:
student(){ stestnum=""; sname=="";}
void setmessage()
{
cin>>stestnum>>sname;
}
string stestnum;//考号
string sname;//姓名
};
student cstu[64];

/********************************************/
const int row=8, col=8; //座位行和列

/********************************************/
void arrange_seat(int seat[][col]);
void cancel_seat(int seat[][col]);
void find_student(int seat[][col]);
void find_seat(int seat[][col]);
void display_seats(int seat[][col]);

/********************************************/
void main()
{
int choose, seat[r