#include<iostream> #include<vector> #include<windows.h> using namespace std; struct Student{ int id; string name; int age; int grade; }s; void maininterface(){ cout<<"*欢迎来到学生管理系统*"<<endl; cout<<"1.新建学生信息"<<endl; cout<<"2.查找学生信息"<<endl; cout<<"3.修改学生信息"<<endl; cout<<"4.删除学生信息"<<endl; cout<<"5.退出该系统"<<endl; } vector<Student> insert(vector<Student> a){ if(s.id==0){ s.id=1000; }else{ s.id=s.id+1; } cin>>s.name>>s.age>>s.grade; a.push_back(s); return a; } vector<Student> search(vector<Student> a){ } vector<Student> revise(vector<Student> a){ } vector<Student> del(vector<Student> a){ } int main(){ vector<Student> a; int n; system("cls"); while(1){ maininterface(); cin>>n; if(n==5){ break; } switch(n){ case 1:{ a=insert(a); break; } } Sleep(2000); system("cls"); } }
标签:管理,int,system,学生,grade,vector,include,id From: https://www.cnblogs.com/wangyueshuo/p/17904537.html