Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
UsingAlgorithm
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//g++ 7.4.0 //using algorithm #include <iostream> #include <algorithm> #include <vector> #include <ctime> using namespace std; const int len=10; vector<int> list; void get_list(){ for (unsigned int i=0;i<list.size();i++){ cout<<list[i]<<","; } cout<<endl; } int main() { for (int i=0;i<len;i++){ list.push_back(rand()%10); } cout << "Using Algorithm !!! \n[ * Random List]:"; get_list(); cout << "[ * Sorted List]:"; sort(list.begin(),list.end()); get_list(); }
g++
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.52 sec, absolute running time: 0.15 sec, cpu time: 0.01 sec, memory peak: 6 Mb, absolute service time: 0,74 sec
edit mode
|
history
|
discussion
Using Algorithm !!! [ * Random List]:3,6,7,5,3,5,6,2,9,1, [ * Sorted List]:1,2,3,3,5,5,6,6,7,9,