#include #include #include using namespace std; struct student { string name; int old; int nianji; }; int main(){ student student1 = {"xiaoming", 10, 2}; student student2 = {"xiaolan", 12, 4}; student student3 = {"xiaohong", 12, 8}; string name; int old, nianji,j,i; student studentx; vector aa; aa.push_back(student1); aa.push_back(student2); aa.push_back(student3); cout<<"please input the student name"<>name; cout<<"please input the student old"<>old; cout<<"please input the student nianji"<>nianji; studentx.name = name; studentx.old = old; studentx.nianji = nianji; for(i = 0; i < aa.size(); i++){ if(studentx.nianji > aa[i].nianji)continue; student tmp = aa[i]; aa[i] = studentx; // cout<<"i = "< i + 1; j--){ cout<<"1111111111111111111"<