Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sdfsdfsd
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++ 5.4.0 #include <iostream> #include <vector> #include <algorithm> int main() { std::vector<double> vec{0.5, 4.3, -1.7, 8.0, -1.4, 2.4}; if ( std::find_if( vec.begin(), vec.end(), [](double x) { return (x < -2); } ) == vec.end() ){ std::transform(vec.begin(), vec.end(), vec.begin(), [](double x) { return ((x < 0)? x * x: x); }); } else { std::transform(vec.begin(), vec.end(), vec.begin(), [](double x) { return (x * 0.01); }); } for (auto e: vec) { std::cout << e << ", "; } }
g++
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.72 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0,88 sec
edit mode
|
history
0.5, 4.3, 2.89, 8, 1.96, 2.4,