Playground
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> v; for (int i=1; i<=10; i++) v.push_back((i*i*i) % 20); //v={1, 8, 7, 4, 5, 16, 3, 12, 9, 0} //podredi gi broevite sort(v.begin(), v.end()); for (int i=0; i<v.size(); i++) cout << v[i] << " "; //pechati "0 1 3 4 5 7 8 9 12 16 " return 0; }
Input data
Program output
no input
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!