Cuenta números


Submit solution

Points: 10
Time limit: 5.0s
Memory limit: 256M

Author:
Problem types
Allowed languages
C#, Go, Java

Se deben ir leyendo números hasta que se lea un 0. El programa debe mostrar la cantidad de números leídos antes del 0.

Input Format

Una secuencia de N números.

Constraints

0 <= 1 <= 10^7

Output Format

Un entero indicando la cantidad de números leídos

Sample Input 0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 0

Sample Output 0

16

Sample Input 1

5 4 2 5 7 0

Sample Output 1

5

Sample Input 2

3 5 6 3 0

Sample Output 2

4

Sample Input 3

8 6 -1 7 0

Sample Output 3

4

Sample Input 4

7 4 6 9 0

Sample Output 4

4

Sample Input 5

5 8 0

Sample Output 5

2

Autoria: Rusben

CC BY-NC-SA 4.0