标签:sort bsp class res color amp pac algorithm while
#include<iostream> #include<vector> #include<algorithm> using namespace std; void main() { vector<unsigned> scores(0); for (decltype(scores.size()) ix = 0; ix < scores.size(); ++ix) { scores.push_back(ix); } sort(scores.begin(), scores.end()); auto beg = scores.begin(), end = scores.end(); auto mid = scores.begin() + scores.size() / 2; int a = 4; while (mid != end && *mid != a) { if (a < *mid) end = mid; else beg = mid + 1; mid = beg + (end - beg) / 2; } system("pause"); }
标签:sort bsp class res color amp pac algorithm while
原文地址:https://www.cnblogs.com/jingchu/p/10347376.html