Statistics on a sequence of numbers EASY Fisiere (BAC) Tablouri vectori (BAC) 10 XP 0 solved
Mobile coding works. A laptop is faster for long sessions.

Problem

Read from standard input a non-negative integer `n` followed by `n` integers, separated by spaces or newlines. Print on a single line, separated by spaces: the sum, the minimum value, and the maximum value of the `n` numbers. **Data is read from standard input** (in the format described), not from a file. The format reproduces the typical content of a text file from the BAC exam, adapted for standard input.

Input format

Input input.txt

The first line contains the non-negative integer `n`. The following lines contain the `n` integers, separated by spaces or newlines. - `1 <= n <= 1000` - the integers are in the range `[-1000000, 1000000]`

Output format

Output output.txt

The program prints to standard output three numbers separated by spaces: the sum, the minimum, and the maximum.

Example

input
5
3 1 4 1 5
output
14 1 5

Ready to solve this challenge?

Create a free account to write code, submit solutions, and track your progress.

⌨️ Keyboard Shortcuts

Code Editor
Run Code
Ctrl Enter
Submit Code
Ctrl Shift Enter
Format Code
Shift Alt F
Toggle Comment
Ctrl /
Undo
Ctrl Z
Redo
Ctrl Y
Navigation
Global Search
/
Show Shortcuts
?
Close Modal
Esc

🔍 Interactive Debugger

0 / 0

Analyzing your code...

📦 Variables

No variables yet

📚 Call Stack
main() line 1
📤 Output
We use cookies

Essential cookies are always active. You can choose to enable preference and analytics cookies. Learn more