Comedy
int main () { std::vector nums = {1}; int val = 0; int pos = 0; bool check = false; auto i = nums.begin(); while (i !=nums.end()) { if((*i) != val) { i++; pos++; } else { check = true; break; } } if (!check) { pos = 0; auto j = nums.begin(); while (j != nums.end()) { if (val > (*j)) { j++; pos++; } else { check = true; break; } } } cout << pos << std::endl; for(int x : nums) { cout << x << "t"; } return ; }