fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <numeric>
  5. int main()
  6. {
  7. std::vector<int> v(10,1 );
  8. std::partial_sum(v.begin(), v.end(), v.begin());
  9. std::random_shuffle(v.begin(), v.end());
  10.  
  11. for(std::size_t n=0; n<v.size(); ++n)
  12. std::cout << v[n] << ' ';
  13. }
  14.  
Success #stdin #stdout 0.01s 2856KB
stdin
Standard input is empty
stdout
5 4 8 9 1 6 3 2 7 10