资讯详情

c++学生信息统计

最近学校的学生统计系统坏了,所以我经历了无数次bug后,写出了12.10版学生信息统计,代码如下:(估计老师很喜欢)

#include<iostream> #include<cstring> #include<cstdio> #include<windows.h> using namespace std; void color(short x)  {  if(x>=0&&x<=15)   SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),x); } struct colorParameters {//颜色调整结构  short frame=8./边框颜色号  short title=9./标题颜色号  short option=3.//正文颜色号  short tacit=15.//默认颜色号  short message=4./信息预览颜色号  short warning=4./警告颜色号 }; colorParameters ers; class Operation {  private:   int number;  public:   void charge(int people);   void inputPeople();   void inputAchievement();   void output();   int total();   void sorting();   void SortingNoOutput();   void lookup(int max,int low);   void replace1(int n);   void replace2(int n);   void clean();   void maximal();   void average(); }; struct student {  int num;  string name; }; student stu[10000]; struct achievement {  float score; }; achievement ach[10000]; struct seqencing {  int num;  string name;  float score; }; seqencing seq[10000]; struct numb {  int num;  string name;  float score; }; numb num; struct maxValue {  int num;  string name;  float score; }; maxValue lue; struct mean {  int num; }; mean ean; void Operation::charge(int people) {  number=people; } void Operation::inputPeople() {  for(int i=0; i<number; i  ) {   cin>>stu[i].num>>stu[i].name;  }  cout<<"输入完毕,跳转到主页";  Sleep(0.5*1000); } void Operation::inputAchievement() {  for(int i=0; i<number; i  ) {   cout<<stu[i].num<<" "<<stu[i].name<<" ";   cin>>ach[i].score;  }  cout<<"输入完毕,跳转到主页";  Sleep(0.5*1000); } void Operation::output() {  for(int i=0; i<number; i  ) {   cout<<stu[i].num<<" "<<stu[i].name<<" "<<ach[i].score<<endl;  } } int Operation::total() {  int to=0;  for(int i=0; i<number; i  ) {   to =ach[i].score;  }  return to; } void Operation::sorting() {  for(int i=0; i<number; i  ) {   seq[i].num=stu[i].num;   seq[i].name=stu[i].name;   seq[i].score=ach[i].score;  }  for(int i=0; i<number; i  ) {   for(int j=0; j<number; j  ) {    if(seq[j].score<seq[j 1].score) {     num.num=seq[j].num;     seq[j].num=seq[j 1].num;     seq[j 1].num=num.num;     num.name=seq[j].name;     seq[j].name=seq[j 1].name;     seq[j 1].name=num.name;     num.score=seq[j].score;     seq[j].score=seq[j 1].score;     seq[j 1].score=num.score;    }   }  }  for(int i=0; i<number; i  ) {   cout<<seq[i].num<<" "<<seq[i].name<<" "<<seq[i].score<<endl;  } } void Operation::SortingNoOutput() {  for(int i=0; i<number; i  ) {   seq[i].num=stu[i].num;   seq[i].name=stu[i].name;   seq[i].score=ach[i].score;  }  for(int i=0; i<number; i  ) {   for(int j=0; j<number; j  ) {    if(seq[j].score<seq[j 1].score) {     num.num=seq[j].num;     seq[j].num=seq[j 1].num;     seq[j 1].num=num.num;     num.name=seq[j].name;     seq[j].name=seq[j 1].name;     seq[j 1].name=num.name;     num.score=seq[j].score;     seq[j].score=seq[j 1].score;     seq[j 1].score=num.score;    }   }  } } void Operation::lookup(int max,int low) {  for(int i=low-1; i<max-1; i  ) {   cout<<i<<" "<<seq[i].num<<" "<<seq[i].name<<" "<<seq[i].score<<endl;  } } void Operation::replace1(int n) {  cout<<"替换前:"<<stu[n-1].num<<" "<<stu[n-1].name<<endl;  cout<<"替换为:";  cin>>stu[n-1].num>>stu[n-1].name;  cout<<"替换完毕,跳转到主页"; } void Operation::replace2(int n) {  cout<<"替换前:"<<stu[n-1].name<<" "<<ach[n-1].score<<endl;  cout<<"替换(替换)";  color(ers.message);  cout<<"分数";  color(ers.tacit);  cout<<"):";  cin>>ach[n-1].score;  cout<<"替换完毕,主页跳转"; } void Operation::clean() {  for(int i=0; i<number; i  ) {   stu[i].num=0;   stu[i].name='\0';   ach[i].score=0;  }  number=0; } void Operation::maximal() {  lue.num=seq[0].num;  lue.name=seq[0].name;  lue.score=seq[0].score; } void Operation::average() {  int totalValue=0;  for(int i=0; i<number; i  ) {   totalValue =ach[i].score;  }  ean.num=totalValue/number; } void help() {  int ndef=0;  system("cls");  system("color 4F");  cout<<"<返回  输入1        "<<endl;  cout<<"===================="<<endl;  cout<<"=      警告!      ="<<endl;  cout<<"===================="<<endl;  cout<<"= 您输入无效信息 ="<<endl;  cout<<"= 请按提示输入 ="<<endl;  cout<<"= 不要输入字符类型 ="<<endl;  cout<<"= 加载时不要输入 ="<<endl;  cout<<"===================="<<endl;  cout<<"=可能会导致输入错误="<<endl;  cout<<"=     系统崩溃     ="<<endl;  cout<<"===================="<<endl;  cout<<"=主程序附加保护程序=<<endl;
	cout<<"===================="<<endl;
	cin>>ndef;
	if(ndef!=1)
		help();
}
void collapse() {
	bool c=true;
	system("color 4F");
	system("cls");
	cout<<"===================="<<endl;
	cout<<"=   崩溃重启程序   ="<<endl;
	cout<<"===================="<<endl;
	cout<<"=程序崩溃,正在重启="<<endl;
	cout<<"===================="<<endl;
	cout<<"=  重启时请勿键入  ="<<endl;
	cout<<"=      请等待      ="<<endl;
	cout<<"=重启后可能丢失部分="<<endl;
	cout<<"=       信息       ="<<endl;
	cout<<"===================="<<endl;
	cout<<"=主程序附加保护程序="<<endl;
	cout<<"===================="<<endl;
	cout<<endl;
	cout<<"Loading..."<<endl;
	Sleep(3*1000);
	system("cls");
	cout<<"===================="<<endl;
	cout<<"=   崩溃重启程序   ="<<endl;
	cout<<"===================="<<endl;
	cout<<"= 即将跳转至主程序 ="<<endl;
	cout<<"=或再次尝试重启程序="<<endl;
	cout<<"=此前勿进行任何操作="<<endl;
	cout<<"===================="<<endl;
	cout<<"=主程序附加保护程序="<<endl;
	cout<<"===================="<<endl;
	Sleep(1.2*1000);
	cout<<endl;
	cout<<"报错信息:"<<endl;
	for(int i=0; i<15; i++) {
		cout<<"Warning:Error!"<<endl;
		Sleep(0.0176*1000);
	}
	Sleep(0.2*1000);
	cout<<"Loading...>>正在处理"<<endl;
	Sleep(0.5*1000);
	system("cls");
}
void skip(int n) {
	system("cls");
	color(ers.frame);
	cout<<"===================="<<endl;
	cout<<"=";
	color(ers.title);
	cout<<"       警告       ";
	color(ers.frame);
	cout<<"="<<endl;
	cout<<"===================="<<endl;
	cout<<"=";
	color(ers.warning);
	cout<<"       错误       ";
	color(ers.frame);
	cout<<"="<<endl;
	cout<<"=";
	color(ers.option);
	cout<<"  即将 进行 处理  ";
	color(ers.frame);
	cout<<"="<<endl;
	cout<<"=";
	color(ers.option);
	cout<<" 或跳转至保护程序 ";
	color(ers.frame);
	cout<<"="<<endl;
	cout<<"===================="<<endl;
	cout<<endl;
	Sleep(2*1000);
	color(ers.tacit);
	if(n==0) {
		collapse();
	} else {
		help();
	}
}
void intercept() {
	system("cls");
	color(ers.frame);
	cout<<"===================="<<endl;
	cout<<"=";
	color(ers.title);
	cout<<"       错误       ";
	color(ers.frame);
	cout<<"="<<endl;
	cout<<"===================="<<endl;
	cout<<"=";
	color(ers.warning);
	cout<<"    无可用信息    ";
	color(ers.frame);
	cout<<"="<<endl;
	cout<<"=";
	color(ers.option);
	cout<<"    详见快捷栏    ";
	color(ers.frame);
	cout<<"="<<endl;
	cout<<"===================="<<endl;
	cout<<"=";
	color(ers.option);
	cout<<"  *2秒后自动返回  ";
	color(ers.frame);
	cout<<"="<<endl;
	cout<<"===================="<<endl;
	color(ers.tacit);
	Sleep(2*1000);
}
int main() {
	while(1) {
		cout<<"启动中"<<endl;
		cout<<"请等待"<<endl;
		cout<<"Loading..."<<endl;
		bool encryption=false;
		bool information=false;
		bool achievement=false;
		Operation myOperation;
		bool run=true;
		int n=0;
		Sleep(0.2*1000);
		int n1=0;
		while(run) {
			system("cls");
			system("color 0F");
			if(information==false&&achievement==false) {
				color(ers.frame);
				cout<<"====================        ===================="<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.title);
				cout<<"学生信息统计主页面";
				color(ers.frame);
				cout<<"=        =";
				color(ers.title);
				cout<<"快捷栏暂无可用信息";
				color(ers.frame);
				cout<<"="<<endl;
				color(ers.frame);
				cout<<"====================        ===================="<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"1:录入学生个人信息";
				color(ers.frame);
				cout<<"=";
				color(ers.message);
				cout<<"        请输入学生信息及成绩";
				color(ers.tacit);
				cout<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"2:录入学生考试成绩";
				color(ers.frame);
				cout<<"=";
				color(ers.warning);
				cout<<"        输入前请不要进行操作";
				color(ers.tacit);
				cout<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"3:显示学生信息成绩";
				color(ers.frame);
				cout<<"=";
				color(ers.warning);
				cout<<"        否则可能导致程序崩溃";
				color(ers.tacit);
				cout<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"4:统计 / 排序 成绩";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"5:学号查找学生成绩";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"6:排名查找符合学生";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"7:更改学生个人信息";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"8:更改学生考试成绩";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"9:清除所有可用信息";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"0:更改程序界面颜色";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"===================="<<endl;
				cout<<"=";
				color(5);
				cout<<"第12次对主程序更新";
				color(ers.frame);
				cout<<"="<<endl;
				cout<<"===================="<<endl;
			} else if(information==true&&achievement==false) {
				color(ers.frame);
				cout<<"====================        ===================="<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.title);
				cout<<"学生信息统计主页面";
				color(ers.frame);
				cout<<"=        =";
				color(ers.title);
				cout<<"已录入学生个人信息";
				color(ers.frame);
				cout<<"="<<endl;
				color(ers.frame);
				cout<<"====================        ===================="<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"1:录入学生个人信息";
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"        学生基本信息:";
				color(ers.frame);
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"2:录入学生考试成绩";
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"        人数:";
				color(ers.message);
				cout<<n1;
				color(ers.frame);
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"3:显示学生信息成绩";
				color(ers.frame);
				cout<<"=";
				color(ers.message);
				cout<<"        请输入考试成绩";
				color(ers.tacit);
				cout<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"4:统计 / 排序 成绩";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"5:学号查找学生成绩";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"6:排名查找符合学生";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"7:更改学生个人信息";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"8:更改学生考试成绩";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"9:清除所有可用信息";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"0:更改程序界面颜色";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"===================="<<endl;
				cout<<"=";
				color(5);
				cout<<"第12次对主程序更新";
				color(ers.frame);
				cout<<"="<<endl;
				cout<<"===================="<<endl;
			} else if(information==true&&achievement==true) {
				myOperation.SortingNoOutput();
				myOperation.maximal();
				myOperation.average();
				color(ers.frame);
				cout<<"====================        ===================="<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.title);
				cout<<"学生信息统计主页面";
				color(ers.frame);
				cout<<"=        =";
				color(ers.title);
				cout<<"已录入学生个人信息";
				color(ers.frame);
				cout<<"="<<endl;
				color(ers.frame);
				cout<<"====================        ===================="<<endl;
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"1:录入学生个人信息";
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"        学生基本信息:";
				color(ers.frame);
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"2:录入学生考试成绩";
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"        人数:";
				color(ers.message);
				cout<<n1;
				color(ers.frame);
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"3:显示学生信息成绩";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"4:统计 / 排序 成绩";
				color(ers.frame);
				cout<<"=";
				cout<<"        ====================";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"5:学号查找学生成绩";
				color(ers.frame);
				cout<<"=";
				cout<<"        =";
				color(ers.title);
				cout<<"已录入学生考试成绩";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"6:排名查找符合学生";
				color(ers.frame);
				cout<<"=";
				cout<<"        ====================";
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"7:更改学生个人信息";
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"        成绩基本信息:";
				color(ers.frame);
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"8:更改学生考试成绩";
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"        最高分:";
				color(ers.message);
				cout<<lue.num<<" "<<lue.name<<" "<<lue.score;
				color(ers.frame);
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"9:清除所有可用信息";
				color(ers.frame);
				cout<<"=";
				color(ers.option);
				cout<<"        平均分:";
				color(ers.message);
				cout<<ean.num;
				color(ers.frame);
				cout<<endl;
				cout<<"=";
				color(ers.option);
				cout<<"0:更改程序界面颜色";
				color(ers.frame);
				cout<<"=";
				cout<<endl;
				cout<<"===================="<<endl;
				cout<<"=";
				color(5);
				cout<<"第12次对主程序更新";
				color(ers.frame);
				cout<<"="<<endl;
				cout<<"===================="<<endl;
			} else {
				myOperation.clean();
				skip(0);
				break;
			}
			color(ers.tacit);
			cout<<endl;
			color(ers.message);
			cout<<"   [";
			color(9);
			cout<<"请选择功能:";
			color(ers.message);
			cout<<"]";
			color(ers.option);
			cout<<endl;
			cin>>n;
			cout<<"Loading..."<<endl;
			if(n<100) {
				switch(n) {
					case 1: {
						n1=0;
						system("cls");
						color(ers.frame);
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.title);
						cout<<" 录入学生信息界面 ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<" 输入人数(";
						color(ers.message);
						cout<<"<10000";
						color(ers.option);
						cout<<") ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						color(ers.tacit);
						cout<<endl;
						cout<<"请按上方提示输入:";
						cin>>n1;
						cout<<"Loading...";
						if(n1<=100) {
							myOperation.charge(n1);
						} else {
							help();
							break;
						}
						system("cls");
						color(ers.frame);
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.title);
						cout<<" 录入学生信息界面 ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						cout<<"= ";
						color(ers.option);
						cout<<"输入具体学生信息";
						color(ers.frame);
						cout<<" ="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<"  格式:学号 姓名  ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						color(ers.tacit);
						cout<<endl;
						cout<<"请按上方提示输入:"<<endl;
						myOperation.inputPeople();
						information=true;
						cout<<"Loading...";
						break;
					}
					case 2: {
						system("cls");
						color(ers.frame);
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.title);
						cout<<" 录入考试成绩界面 ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<"按学号输入考试成绩";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<" 以回车键分隔成绩 ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						color(ers.tacit);
						cout<<endl;
						cout<<"请按上方提示输入:"<<endl;
						myOperation.inputAchievement();
						achievement=true;
						cout<<"Loading...";
						break;
					}
					case 3: {
						if(information==true&&achievement==true) {
							int n3=0;
							system("cls");
							color(ers.tacit);
							cout<<"<返回  输入1"<<endl;
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 显示信息成绩界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<"     信息如下     ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							myOperation.output();
							cout<<endl;
							cin>>n3;
							cout<<"Loading...";
							if(n3==1)
								break;
							else {
								help();
								break;
							}
						} else
							intercept();
						break;
					}
					case 4: {
						if(information==true&&achievement==true) {
							int n4=0;
							system("cls");
							cout<<"<返回  输入3"<<endl;
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<"统计/排序 成绩界面";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<"    1:统计总分    ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<"    2:成绩排序    ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							cin>>n4;
							cout<<"Loading...";
							if(n4==1) {
								int n41=0;
								system("cls");
								color(ers.tacit);
								cout<<"<返回  输入1"<<endl;
								color(ers.frame);
								cout<<"===================="<<endl;
								cout<<"=";
								color(ers.title);
								cout<<"   统计总分界面   ";
								color(ers.frame);
								cout<<"="<<endl;
								cout<<"===================="<<endl;
								color(ers.tacit);
								cout<<endl;
								cout<<"本次测试的总分是:"<<myOperation.total();
								cout<<endl;
								color(ers.message);
								cout<<"您可以在快捷栏内进行预览"<<endl;
								color(ers.tacit);
								cout<<endl;
								cin>>n41;
								cout<<"Loading...";
								if(n41==1)
									break;
								else {
									help();
									break;
								}
							} else if(n4==2) {
								int n42=0;
								system("cls");
								cout<<"<返回  输入1"<<endl;
								color(ers.frame);
								cout<<"===================="<<endl;
								cout<<"=";
								color(ers.title);
								cout<<"   成绩排序界面   ";
								color(ers.frame);
								cout<<"="<<endl;
								cout<<"===================="<<endl;
								cout<<"=";
								color(ers.option);
								cout<<"     排序如下     ";
								color(ers.frame);
								cout<<"="<<endl;
								cout<<"===================="<<endl;
								color(ers.tacit);
								cout<<endl;
								myOperation.sorting();
								cout<<endl;
								cin>>n42;
								cout<<"Loading...";
								if(n42==1)
									break;
								else {
									help();
									break;
								}
							} else if(n4==3) {
								break;
							} else {
								help();
								break;
							}
						} else {
							intercept();
							break;
						}
					}
					case 5: {
						if(information==true&&achievement==true) {
							int n5=0;
							system("cls");
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 学号查找成绩界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<"输入查找学生的学号";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							cout<<"请按上方提示输入:";
							cin>>n5;
							cout<<"Loading..."<<endl;
							int Return=0;
							system("cls");
							cout<<"<返回  输入1"<<endl;
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"= ";
							color(ers.title);
							cout<<"学号查找学生成绩 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							cout<<"该学生信息:"<<endl;
							cout<<"学号:"<<stu[n5-1].num<<endl;
							cout<<"姓名:"<<stu[n5-1].name<<endl;
							cout<<"成绩:"<<ach[n5-1].score<<endl;
							cout<<endl;
							cin>>Return;
							cout<<"Loading...";
							if(Return==1)
								break;
							else {
								help();
								break;
							}
						} else {
							intercept();
							break;
						}
					}
					case 6: {
						if(information==true&&achievement==true) {
							int max=0;
							int low=0;
							system("cls");
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 排名查找学生界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<" 输入查找排名区间 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<"格式:最";
							color(ers.message);
							cout<<"大";
							color(ers.option);
							cout<<"值 最";
							color(ers.message);
							cout<<"小";
							color(ers.option);
							cout<<"值";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							cout<<"请按上方提示输入:";
							cin>>max>>low;
							cout<<"Loading...";
							if(max<=low) {
								help();
								break;
							}
							int n6;
							myOperation.sorting();
							system("cls");
							color(ers.tacit);
							cout<<"<返回  输入1"<<endl;
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 排名查找学生界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							cout<<low;
							color(ers.option);
							cout<<"~";
							color(ers.tacit);
							cout<<max;
							color(ers.option);
							cout<<"名学生信息:"<<endl;
							color(ers.tacit);
							for(int i=low-1; i<max; i++) {
								cout<<i+1<<" "<<seq[i].num<<" "<<seq[i].name<<" "<<seq[i].score<<endl;
							}
							cout<<endl;
							cin>>n6;
							if(n6==1) {
								cout<<"loading...";
								break;
							} else {
								help();
								break;
							}
						} else {
							intercept();
							break;
						}
					}
					case 7: {
						if(information==true) {
							int n7=0;
							system("cls");
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 更改学生信息界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<" 输入更改学生学号 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							cout<<"请按上方提示输入:";
							cin>>n7;
							cout<<"Loading...";
							system("cls");
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 更改学生信息界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							myOperation.replace1(n7);
							cout<<"Loading...";
							break;
						} else {
							intercept();
							break;
						}

					}
					case 8: {
						if(information==true&&achievement==true) {
							int n8=0;
							system("cls");
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 更改考试成绩界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<" 输入更改学生学号 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							cout<<"请按上方提示输入:";
							cin>>n8;
							cout<<"Loading...";
							system("cls");
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 更改考试成绩界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							myOperation.replace2(n8);
							cout<<"Loading...";
							break;
						} else {
							intercept();
							break;
						}

					}
					case 9: {
						if(information==true&&achievement==true) {
							int n10=0;
							system("cls");
							color(ers.frame);
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.title);
							cout<<" 清除学生信息界面 ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<"清除的数据无法恢复";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"=";
							color(ers.option);
							cout<<"    是否清除?    ";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"=";
							color(ers.warning);
							cout<<"1:清除      ";
							color(ers.option);
							cout<<"2:取消";
							color(ers.frame);
							cout<<"="<<endl;
							cout<<"===================="<<endl;
							color(ers.tacit);
							cout<<endl;
							cin>>n10;
							cout<<"Loading...";
							if(n10==1) {
								myOperation.clean();
								information=false;
								achievement=false;
								break;
							} else if(n10==2) {
								break;
							} else {
								help();
								break;
							}
						} else {
							intercept();
							break;
						}

					}
					case 0: {
						int n01;
						system("cls");
						color(ers.frame);
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.title);
						cout<<" 更改程序颜色界面 ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<"输入更改颜色的区域";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<"1:边框      2:标题";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<"3:正文      4:默认";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<"5:预览      6:警告";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						color(ers.tacit);
						cout<<endl;
						cin>>n01;
						system("cls");
						int n02;
						color(ers.frame);
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.title);
						cout<<" 更改程序颜色界面 ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						cout<<"=";
						color(ers.option);
						cout<<"     色号:1~15    ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						cout<<"=";
						color(1);
						cout<<"1 ";
						color(2);
						cout<<"2 ";
						color(3);
						cout<<"3 ";
						color(4);
						cout<<"4 ";
						color(5);
						cout<<"5 ";
						color(6);
						cout<<"6 ";
						color(7);
						cout<<"7 ";
						color(8);
						cout<<"8 ";
						color(9);
						cout<<"9 ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"=";
						color(10);
						cout<<"10 ";
						color(11);
						cout<<"11 ";
						color(12);
						cout<<"12 ";
						color(13);
						cout<<"13 ";
						color(14);
						cout<<"14 ";
						color(15);
						cout<<"15 ";
						color(ers.frame);
						cout<<"="<<endl;
						cout<<"===================="<<endl;
						color(ers.tacit);
						cout<<endl;
						cin>>n02;
						if(n01==1)
							ers.frame=n02;
						else if(n01==2)
							ers.title=n02;
						else if(n01==3)
							ers.option=n02;
						else if(n01==4)
							ers.tacit=n02;
						else if(n01==5)
							ers.message=n02;
						else if(n01==6)
							ers.warning=n02;
						else
							help();
						cout<<"更改完毕";
						Sleep(0.5*1000);
						break;
					}
					default: {
						help();
						break;
					}
				}
			}
			else {
				system("cls");
				cout<<"错误!";
				return 0;
			}
		}
		collapse();
	}
	return 0;
}

代码制作不易,有不足之处还请见谅,别忘了加关注哦!

下期更精彩~

标签: 2513n10tc接近传感器

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台