CT1516

The Positive Count Beneath Frostgate

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Weaver runs the tannery at the northern keep of Frostgate. Today the books show a list of lanterns, and the numbers must be worked out before sundown. 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 <= 63; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 25 540521 297775 456198 690568 69843 648484 946222 506155 962164 279253 434053 98963 259576 702827 142463 22105 596439 575523 465431 929300 74550 354535 16272 328940 512608
Output: 25

Example 2:

Input: 17 323352 395828 75242 762063 390680 368199 505477 373194 974162 882269 760035 225591 43865 241075 671670 359683 166876
Output: 17

Example 3:

Input: 9 805143 347402 494337 619759 391893 127695 185762 999121 276407
Output: 9

Constraints:

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

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