Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
candies
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 total no of child:"<<endl; cin>>n; int extraCandies; cout<<"Enter extra candies:"<<endl; cin>>extraCandies; bool str2[n]={}; int i; int arr[n]; for(i=0;i<n;i++) {cin>>arr[i];} int maximum=*max_element(arr,arr+n); for(i=0;i<n;i++) { if (arr[i]+extraCandies>=maximum) {cout<<"True"<<endl;} else {cout<<"False"<<endl;} } return 0; }
g++
8 2 0 9 0 7 6 1 2 2
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 1.83 sec, absolute running time: 0.19 sec, cpu time: 0.01 sec, memory peak: 5 Mb, absolute service time: 2,08 sec
edit mode
|
history
|
discussion
Enter total no of child: Enter extra candies: False True False True False False False False