CT2027

The Thornveld Positive Count

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the acacia flats of Thornveld pays by the answer, and Chavi intends to earn it. First: the full register of crates. 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 <= 31; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 22 689 896 -83 341 54 60 87 569 322 617 837 964 445 540 95 401 749 468 164 764 -19 275
Output: 20

Example 2:

Input: 30 924 351 946 144 35 519 759 224 668 53 480 351 451 619 840 326 342 855 558 410 186 474 601 72 -30 130 47 276 118 738
Output: 29

Example 3:

Input: 23 363 262 486 352 683 963 782 -4 -99 614 403 526 69 310 68 108 978 196 -78 -12 516 770 189
Output: 19

Constraints:

1 <= n <= 31; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.
The Thornveld Positive Count - EASY Coding Problem | CodeTikki