正文
增加 2 行删除 2 行
3 行未改动45678910111213141516171819203 行未改动struct nn{int num;bool operator < ( const nn & x ) const {return num < x.num;}}a[10];int main() {int n,m;cin>>n;for (int i = 1; i <= n; ++i) {cin>>a[i].num;}cin>>m;cout<<lower_bound( a + 1 , a + 1 + n , (nn){ m } ) - a;}```输出第一个在a数组里大于等于m的数的下标3 行未改动45678910111213141516171819203 行未改动struct nn{int num;bool operator < ( const nn & x ) const {return num < x.num;}}a[10];int main() {int n,m;cin>>n;for (int i = 1; i <= n; ++i) {cin>>a[i].num;}cin>>m;cout<<lower_bound( a + 1 , a + 1 + n , (nn){ m } ) - a;}```输出第一个在a数组里大于等于m的数的下标