c++学生系统(gezhengxu2024独创)

前言:实在懒得用vector了,所以没有删除学生,等破300粉丝我就加删除学生。(还有亿些问题)

=========================================================================

#include
#include
using namespace std;
string xue[5001],xingbie[5001];
long int xuehao[5001],jifen[5001],zhan=0;
int read()
{
    char ch=_getch();
    while(ch>'9'||ch<'0') ch=_getch();
    return ch-48;
}
void Read(){
    ifstream in("学生档案.txt");
    in>>zhan;
    for(int i=1;i<=5000;i++) in>>xue[i]>>xingbie[i]>>xuehao[i]>>jifen[i];
    in.close();}
void Save(){
    ofstream out("学生档案.txt");
    out<xuehao[j+1])
			{
				swap(jifen[j],jifen[j+1]);
				swap(xuehao[j],xuehao[j+1]);
				swap(xingbie[j],xingbie[j+1]);
				swap(xue[j],xue[j+1]);
			}
		 } 
	}
	for(int i=1;i<=zhan;i++)
	{
		cout<<"学号:"<>s;
		system("cls");
		else if(s==5)
		{
			if(zhan==0) 
			{
				cout<<"你没学生!!!!!";
				system("pause");
				continue; 
			}
			cout<<"1:学号减去\n2:姓名减去\n";
			long int jinitaimei;
			cin>>jinitaimei;
			if(jinitaimei==1)
			{
				cout<<"请输入学号和要减去的积分:\n";
				long int xh,jf;
				cin>>xh>>jf;
				for(int i=1;i<=zhan;i++)
				{
					if(xuehao[i]==xh)
					{
						jifen[i]-=jf;
						cout<<"减去成功!";
						Save();
						system("pause");
						continue;  
					}
				}
			}
			else if(jinitaimei==2)
			{
				cout<<"请输入姓名和要减去的积分:\n";
				long int jf;
				string xm;
				cin>>xm>>jf; 
				for(int i=1;i<=zhan;i++)
				{
					if(xue[i]==xm)
					{
						jifen[i]+=jf;
						cout<<"减去成功!"; 
						Save();
						system("pause");
						continue; 
					}
				}
			}
		}
		if(s==7)
		{
			if(zhan==0) 
			{
				cout<<"你没学生!!!!!";
				system("pause");
				continue; 
			}
			cout<<"1:学号添加\n2:姓名添加\n";
			long int jinitaimei;
			cin>>jinitaimei;
			if(jinitaimei==1)
			{
				cout<<"请输入学号:\n";
				long int xh;
				cin>>xh;
				int c,d,e,f,g,h,z=0;
				printf("学习态度:");
				c=read();
				printf("\n知识掌握:");
				d=read();
				printf("\n应用测评:");
				e=read();
				printf("\n座位整洁:");
				g=read();
				printf("\n签到:");
				f=read();
				if(f==3)
				{
					z+=30;
					Save();
				}
				else if(f==2)
				{
					z+=10;
					Save();
				}
				else if(f==1)
				{
					z+=0;
					Save();
				}
				if(g==5)
				{
					z+=10;
					Save();
				}
				h=c+d+e;
				h/=3;
				if(h==5)
				{
					z+=50;
					Save();
				}
				else if(h==4)
				{
					z+=10;
					Save();
				}
				else if(h<=3)
				{
					z+=0;
					Save();
				}
				for(int i=1;i<=zhan;i++)
				{
					if(xuehao[i]==xh)
					{
						jifen[i]+=z;
						cout<<"添加成功!";
						Save();
						system("pause");
						continue;  
					}
				}
			}
			else if(jinitaimei==2)
			{
				cout<<"请输入姓名:\n";
				string xm;
				cin>>xm; 
				int c,d,e,f,g,h,z=0;
				printf("学习态度:");
				c=read();
				printf("\n知识掌握:");
				d=read();
				printf("\n应用测评:");
				e=read();
				printf("\n座位整洁:");
				g=read();
				printf("\n签到:");
				f=read();
				if(f==3)
				{
					z+=30;
					Save();
				}
				else if(f==2)
				{
					z+=10;
					Save();
				}
				else if(f==1)
				{
					z+=0;
					Save();
				}
				if(g==5)
				{
					z+=10;
					Save();
				}
				h=c+d+e;
				h/=3;
				if(h==5)
				{
					z+=50;
					Save();
				}
				else if(h==4)
				{
					z+=10;
					Save();
				}
				else if(h<=3)
				{
					z+=0;
					Save();
				}
				for(int i=1;i<=zhan;i++)
				{
					if(xue[i]==xm)
					{
						jifen[i]+=z;
						cout<<"添加成功!"; 
						Save();
						system("pause");
						continue; 
					}
				}
			}
			else
			{
				printf("无用数字!");
				system("pause");
				continue; 
			}
		}
		else if(s==8)
		{
			printf("退出成功!");
			Save();
			return 0; 
		}
		else if(s==1)
		{
			if(zhan==5000)
			{
				printf("学生已到5000人极限,无法添加!");
				system("pause");
				continue; 
			}
			zhan+=1;
			cout<<"请输入姓名:";
			cin>>xue[zhan];
			cout<<"请输入性别:";
			cin>>xingbie[zhan];
			cout<<"请输入学号:";
			cin>>xuehao[zhan];
			Save();
		}
		else if(s==2)
		{
			if(zhan==0) 
			{
				cout<<"你没学生!!!!!";
				system("pause");
				continue; 
			}
			else if(zhan==1)
			{
				cout<<"你就一个,排什么排!!!!!!";
				system("pause");
				continue; 
			}
			paixuehao();
		}
		else if(s==3)
		{
			if(zhan==0) 
			{
				cout<<"你没学生!!!!!";
				system("pause");
				continue; 
			}
			else if(zhan==1)
			{
				cout<<"你就一个,排什么排!!!!!!";
				system("pause");
				continue; 
			}
			paijifen();
		}
		else if(s==4)
		{
			if(zhan==0) 
			{
				cout<<"你没学生!!!!!";
				system("pause");
				continue; 
			}
			cout<<"1:学号添加\n2:姓名添加\n";
			long int jinitaimei;
			cin>>jinitaimei;
			if(jinitaimei==1)
			{
				cout<<"请输入学号和要添加的积分:\n";
				long int xh,jf;
				cin>>xh>>jf;
				for(int i=1;i<=zhan;i++)
				{
					if(xuehao[i]==xh)
					{
						jifen[i]+=jf;
						cout<<"添加成功!";
						Save();
						system("pause");
						continue;  
					}
				}
			}
			else if(jinitaimei==2)
			{
				cout<<"请输入姓名和要添加的积分:\n";
				long int jf;
				string xm;
				cin>>xm>>jf; 
				for(int i=1;i<=zhan;i++)
				{
					if(xue[i]==xm)
					{
						jifen[i]+=jf;
						cout<<"添加成功!"; 
						Save();
						system("pause");
						continue; 
					}
				}
			}
			else
			{
				printf("无用数字!");
				system("pause");
				continue; 
			}
		}
		else if(s==6)
		{
			if(zhan==0) 
			{
				cout<<"你没学生!!!!!";
				system("pause");
				continue; 
			}
			cout<<"请输入姓名:";
			string xm;
			cin>>xm;
			for(int i=1;i<=zhan;i++)
			{
				if(xue[i]==xm) cout<

你可能感兴趣的:(c++,系统,c++,学生系统)