.....

#include<stdio.h>
#include<vector>
#include<algorithm> 
using namespace std;
int main(){
   vector<int> gao1;
   int N,M; 
   scanf("%d%d",&N,&M); 
   int x; 
   for(int i=0;i<N;i++){
     scanf("%d",&x);
     gao1.push_back(x); 
   }
   sort(gao1.begin(),gao1.end()); 
   for(int i=0;i<M;i++){
      int x;
      scanf("%d",&x);
      vector<int>::iterator it=lower_bound(gao1.begin(),gao1.end(),4);
      if(it==gao1.end())puts("not found");
      else printf("%d
",*it); 
   } 

} 
原文地址:https://www.cnblogs.com/michaeljunlove/p/3890366.html