ÀÂÒ
Language:

Remote Training on Programming

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

636. matrix

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

To define the sum of positive and the sum of the negative elements of the matrix by sizes N*M (N and M are not much than 10). The meaning are inducted by the user, to introduct the matrix line by line. If M and N are less or equal zero, or excess 10 to remove 0.

input data

the quantity of the line and  the quantity of the column in the matrix through the gap, the elements of the matrix line by line through the gap

output data

the sum of positive elements, the sum of the negative elements (through ENTER)

example input data

3 4

1 2 3 4

1 5 4 8

9 -1 2 3

example output data

42

-1

 

author: Zibjuk T.V.

 

 


View Problem Statistics Submit Author/source:
Educational Courses / New problems in testing /
635. massivchik 636. 1070. max min 1043. n-êîðíåé 1075. summa drobei
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 0.468 sec.
© Copyright VSTU, AVT, Nosov D.A.