<span style="font-size:18px;">#include<cstdio>
#include<algorithm>//必须的头文件
using namespace std;
int main()
{
int num[10]={1,1,1,3,4,5};
int a;
while(scanf("%d",&a)!=EOF)
{
int temp;
temp=upper_bound(num,num+6,a)-num;//按照从小到大排序, 第一个>a的位置
printf("%d****\n",temp);
temp=lower_bound(num,num+6,a)-num;//按照从小到大,第一个<=a的位置
printf("%d******\n",temp);
}
return 0;
}
/* 如果 输入0他们的返回值都是 0也就是说明了返回的最小位置是0
返回的最大位置是上线 6 序列必须是从小到大的顺序,要不然会出错的
*/</span>