Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
27
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
// Example program #include <iostream> using namespace std; //sfml int main() { int n; cin >> n; int a[8]; int max = -1 , maxPr = -1; int t1, t2, t3; for(int i = 0; i<8; i++){ cin >> a[i]; //cout << a[i] << " "; } //cout << endl; for(int i = 0; i<(n-8); i++){ cin >> t1; //cout << a[0] << " " << t1 <<endl; if(a[0] > max){ max = a[0]; //cout << a[0] << " " << t1 <<endl; } t2 = a[0]; for(int k = 1; k<8; k++){ t3 = a[k]; a[k] = t2; t2 = t3; } a[0] = t1; /*for(int k = 0; k<8; k++){ cout << a[k] << " "; } cout << endl;*/ if(max*t1>maxPr){ maxPr = max*t1; } //a[0] = t1; } cout << maxPr; return 0; }
g++
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
edit mode
|
history
|
discussion