CT408

Qadir's tickets Reckoning

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The harbor bell rings at the spice bazaar of Saffronia; Qadir weighs the day's tickets manifests and starts the calculations. Task: Read n integers and print the sum of all even values. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of even values (0 if none). Constraints: 1 <= n <= 96; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 89 -618773 -468965 -533691 -23131 -946733 -176653 -502324 -455490 -395046 -693349 -69394 -315285 -623601 -846040 -31128 871 -405943 -30821 -644672 -68052 -986293 -172372 -262624 -846920 -197066 -222129 -116763 -864210 -711553 -402373 -992204 -585308 -482975 -639921 -317451 -601513 -776448 -489754 -761546 -197014 -334286 -289792 -215244 -398783 -844149 -256898 -501772 -62106 -615235 -214332 -176896 -810659 -189750 -839317 -789083 -405404 -226971 -447511 -967812 -546791 -979618 -979238 -937575 -463016 -840224 -843660 -872449 -251164 -916321 -505352 -969176 -670601 -414719 -846983 -971195 -540436 -951382 -285663 -936568 -279884 -885042 -901953 -827754 -331536 -649914 -630760 -331382 -675736 -635906
Output: -26279652

Example 2:

Input: 14 -248798 -831918 -587983 -172502 -846339 -971200 -819311 -765756 -356206 -826908 -490656 -133351 -450966 -400524
Output: -5515434

Example 3:

Input: 67 -268560 -36671 -140893 -504682 -392077 -53327 -463840 -200027 -295125 -156161 -830791 -283596 -879757 -678735 -820003 -441091 -589740 -955981 -686053 -426822 -266375 -317730 -679255 -858953 -66997 -39813 -862606 -364896 -75933 -990797 -454532 -267273 -742345 -519585 -666557 -799531 -20693 -321095 -962885 -945353 -712231 -112935 -153932 -947642 -758740 -416298 -9870 -538544 -52803 -423459 -633381 -711575 -166372 -903237 -821895 -157758 -680810 -941115 -191023 -312663 -831679 -79302 -576502 -751924 -32230 -212735 -70947
Output: -9806928

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Qadir's tickets Reckoning - EASY Coding Problem | CodeTikki