#includeiostream#includeiomanip#defineN3usingnamespacestd;structstudent{intnum;charname[80];intage;intgread[3];intsum;};intmain(){structstudentstu[N];coutinputtheinformationofthestudent.endl;for(inti=0;iN;i++){cinstu[i].numstu[i].namestu[i].gread[0]stu[i].gread[1]stu[i].gread[2]stu[i].age;stu[i].sum=(stu[i].gread[0]+stu[i].gread[1]+stu[i].gread[2])/3;}structstudenttemp;for(inti=0;iN-1;i++){for(intj=0;jN-1-i;j++){if(stu[j].sumstu[j+1].sum){temp=stu[j];stu[j]=stu[j+1];stu[j+1]=temp;}}}for(inti=0;iN;i++){coutstu[i].numendlstu[i].nameendl;coutstu[i].gread[0]stu[i].gread[1]stu[i].gread[2]stu[i].ageendl;coutstu[i].sumendl;}return0;}