栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

c++学生信息统计

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

c++学生信息统计

最近学校的学生统计系统坏了,于是乎,我在经历了无数个bug后,写出了12.10版本的学生信息统计,代码如下:(老师估计挺喜欢)

#include
#include
#include
#include
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>stu[i].num>>stu[i].name;
	}
	cout<<"输入完毕,正在跳转至主页面";
	Sleep(0.5*1000);
}
void Operation::inputAchievement() {
	for(int i=0; i>ach[i].score;
	}
	cout<<"输入完毕,正在跳转至主页面";
	Sleep(0.5*1000);
}
void Operation::output() {
	for(int i=0; istu[n-1].num>>stu[n-1].name;
	cout<<"替换完毕,正在跳转至主页面";
}
void Operation::replace2(int n) {
	cout<<"替换前:"<ach[n-1].score;
	cout<<"替换完毕,正在跳转这主页面";
}
void Operation::clean() {
	for(int i=0; i>ndef;
	if(ndef!=1)
		help();
}
void collapse() {
	bool c=true;
	system("color 4F");
	system("cls");
	cout<<"===================="<>正在处理"<>n;
			cout<<"Loading..."<>n1;
						cout<<"Loading...";
						if(n1<=100) {
							myOperation.charge(n1);
						} else {
							help();
							break;
						}
						system("cls");
						color(ers.frame);
						cout<<"===================="<>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"<>n4;
							cout<<"Loading...";
							if(n4==1) {
								int n41=0;
								system("cls");
								color(ers.tacit);
								cout<<"<返回  输入1"<>n41;
								cout<<"Loading...";
								if(n41==1)
									break;
								else {
									help();
									break;
								}
							} else if(n4==2) {
								int n42=0;
								system("cls");
								cout<<"<返回  输入1"<>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<<"===================="<>n5;
							cout<<"Loading..."<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<<"===================="<>max>>low;
							cout<<"Loading...";
							if(max<=low) {
								help();
								break;
							}
							int n6;
							myOperation.sorting();
							system("cls");
							color(ers.tacit);
							cout<<"<返回  输入1"<>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<<"===================="<>n7;
							cout<<"Loading...";
							system("cls");
							color(ers.frame);
							cout<<"===================="<>n8;
							cout<<"Loading...";
							system("cls");
							color(ers.frame);
							cout<<"===================="<>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<<"===================="<>n01;
						system("cls");
						int n02;
						color(ers.frame);
						cout<<"===================="<>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;
}

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

下期更精彩~

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1019311.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号