lower_bound求助
  • 板块学术版
  • 楼主fkjhzhkjv
  • 当前回复6
  • 已保存回复6
  • 发布时间2023/12/20 19:01
  • 上次更新2023/12/20 21:37:39
查看原帖
lower_bound求助
992438
fkjhzhkjv楼主2023/12/20 19:01
#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的位置,一直错。。。

2023/12/20 19:01
加载中...