Chess board (1)

Consider a chess board with r rows and c columns, where every square
contains between 0 and 9 coins. Write a program such that, given a chess
board, computes the total number of coins on it.

Input

Input begins with the number of rows r and the number of columns c.
Follow r lines, each one with c characters between ‘0’ and ‘9’.

Output

Print the total number of coins on the board.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T11:08:31.860Z

© Jutge.org, 2006–2026.
https://jutge.org
