#include<bits/stdc++.h> using namespace std; int main(){ int a[114514]; int x, z; int::iterator y; cin >> z; for(int i = 1;i <= x;++i)cin >> a[i]; while(1){ cin >> x; y = lower_bound(a[1], a[z], x); cout << y << endl; } }
我想学习这东西,想实现查找数组中x的位置,一直错。。。