ÀÂÒ
Language:

Remote Training on Programming

Problems On-line status Contests FAQ
For authors:
Register  ||  Login
 
Hello, Guest! Login or register.

667. Average arithmetic

Time Limit: 1 seconds
Memory Limit:1000KB
Points:2
View Problem Statistics Submit Problem added Undefined

Average arithmetic

 

To define an average arithmetic all positive elements of a matrix (a matrix not square) the sizes N*M (N and M it is no more 10). A matrix to generate from random numbers in a range from-100 to 100.

 

Input data

The sizes of a matrix are set by input about keyboards (integers) through ENTER.

 

Output data

Quantity of negative, non-negative elements are deduced since a new line. An average arithmetic all non-negative elements are deduced too since a new line + one blank. Value average arithmetic two signs after a comma, for example: 2.83

 

Example input data

3

2

7

-6

0

0

2

-4

 

Example output data

2

4

 2.25

 

The author

Bogdanova E.A.


View Problem Statistics Submit Author/source:
Educational Courses / New problems in testing /
674. Amount numbers in given range 667. 623. Bracket 675. Calculate the sequence 670. Change of places of the first words
We can all benefit by doing occasional "toy" programs, when artificial restrictions are set up, so that we are forced to push our abilities to the limit. The art of tackling miniproblems with all our energy will sharpen our talents for the real problems. Donald E. Knuth.
time generating 1.108 sec.
© Copyright VSTU, AVT, Nosov D.A.