← Problem book: C
Lesson 64 of 96 · 10 XP
Largest pair of neighbours
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
The first line contains the count of numbers n (n ≥ 2), the second — the n integers themselves, separated by spaces.
Print the largest sum of two neighbouring numbers.
Example
Input:
5
1 5 2 6 1
Output:
8
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.