#include <iostream>
#include <vector>
#include <stdlib.h> //srand() rand()
#include <time.h> //time(NULL)
#include <numeric> //accumulate
using namespace std;
int main(){
//define instance and iterator
vector<int> grade;
vector<int>::iterator iter;
//get number from user
cout<<"input the num of stu: ";
int num;
cin>>num;
//allocate random value
srand(time(NULL));
for(int i=0;i<num;++i)
grade.push_back(1+rand()%100);
//get average grade and above grades
int sum,aver;
sum=accumulate(grade.begin(),grade.end(),0);
aver=sum/num;
cout<<"aver: "<<aver<<'\n'<<"above aver grades: ";
for(iter=grade.begin();iter<grade.end();++iter){
if(*iter>aver)
cout<<*iter<<' ';
}
}