#include <bits/stdc++.h> #include <windows.h> using namespace std; struct Student{ int id;//学号 string name;//姓名 int age;//年龄 int grade;//班级 }s; void zhujm(){ cout<<"欢迎来到学生管理系统!!"<<endl; 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+=1; } cin>>s.name>>s.age>>s.grade; a.push_back(s); } vector<Student> search(vector<Student> a){ } int main(){ vector<Student> a; while(1){ zhujm(); int n; cin>>n; if(n==5){ cout<<"再见!"<<endl; break; } switch(n){ case 1:{ a=insert(a); cout<<"建立成功!"<<endl; Sleep(1000); system("cls"); break; } case 2:{ search(a); break; } } } return 0; }
标签:cout,管理系统,int,学生,grade,vector,include,id From: https://www.cnblogs.com/fushuxuan/p/17904545.html