CT922

Kabir Counts the ingots

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Deep in the mining town of Ironvein, Kabir studies rows of ingots entries. One clean number will settle the guild's oldest argument. Task: Read n integers and print how many are strictly positive. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of positive values. Constraints: 1 <= n <= 62; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 37 5 8 8 4 8 5 8 7 7 0 10 8 7 4 9 6 7 3 4 6 8 7 3 9 7 9 3 3 3 1 7 4 4 6 8 1 7
Output: 36

Example 2:

Input: 44 9 0 9 9 1 10 10 10 4 7 10 8 0 2 1 10 6 0 1 0 10 4 8 4 8 0 10 2 6 4 1 1 2 2 4 2 1 8 5 4 4 5 4 1
Output: 39

Example 3:

Input: 35 4 0 8 9 3 3 4 2 10 2 2 9 2 0 5 6 5 8 7 5 0 0 1 4 8 9 8 3 6 3 5 9 6 1 10
Output: 31

Constraints:

1 <= n <= 62; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.
Kabir Counts the ingots - EASY Coding Problem | CodeTikki