fork download
#include <iostream>
#include<vector>
#include<algorithm>

int main () {
  

     double x[] = {10, 12.5, 12.9, 13.7, 50.07};
    size_t length = sizeof(x)/sizeof(x[0]);
    std::vector<double> vx(x, x+length);
    
    auto it =std::partition(vx.begin(), vx.end(), [](const double & p){ return p <11;});
    for(auto i:vx)
     std::cout<<i<<" ";
     std::cout<<std::endl;
     
     it++;
     if( it!= vx.end())
            std::cout<<"Element :"<<*it;
    
}
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
10 12.5 12.9 13.7 50.07 
Element :12.9