Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
suffle array
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
#include <bits/stdc++.h> using namespace std; int main() { int n; //cout<<"Enter the size: "<<endl; cin>>n; int i;int nums[2*n]; for(i=0;i<2*n;i++) {cin>>nums[i];} int p1=0,p2=n, reasult[2*n]={}; for(i=0;i<2*n;i++) { if(i%2==0){reasult[i]=nums[p1++];} else {reasult[i]=nums[p2++];} cout<<reasult[i]<<endl; } return 0; }
g++
5 2 5 9 7 6 2 1 4 6 2
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 1.22 sec, absolute running time: 0.14 sec, cpu time: 0.01 sec, memory peak: 5 Mb, absolute service time: 1,41 sec
edit mode
|
history
|
discussion
2 2 5 1 9 4 7 6 6 2