HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2011-11-3. 50588 - Processing the list of numbers

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 50779 - The shortest path in a maze
• 2011-04-1. 50586 - Prime Palindromes
• 2011-04-2. 50585 - Inner Product
• 2011-04-3. 50587 - Modular Convers...
• 2011-05-1. 50767 - Censor
• 2011-05-2. 50652 - Prime Factorization
• 2011-05-3. 50653 - Long Divide
• 2011-11-1. 50565 - Binary numbers
• 2011-11-3. 50588 - Processing ...
• 2012-02-2. 50577 - Perfect Numbers...
• 2012-02-4. 50594 - Transformations
• 2012-02-5. 50768 - Where is Waldorf?
• 2012-02-7. 50704 - Connected?
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-03-01. 50563 - Long Modulus
• 2012-03-02. 50567 - Input Data No...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Processing the list of numbers

Shqip

In a file there is a list of positive numbers ending with a negative number (-1).

Your program should count the numbers and output the sum and their average (integer). In the list contains maximally 10000 integer numbers, with maximally 8 digits. Number -1 determines the end of the list. (use while loop)

Input
You will be given a list of n positive numbers ending with a negative one (-1), where 0 ≤ n ≤ 10000 and each of the n numbers has maximally 8 digits.

Output
The output will be three numbers in a line: cnt, sum, ave, respectively showing:
   cnt - number of numbers in the list;
   sum - the sum of the numbers in the list;
   ave - the average of the given numbers.


Input Output
5 7 3 4 8 -1
5 27 5

Для отправки решений необходимо выполнить вход.

www.contester.ru