CT26406

Asha and the Lazy ingots

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

In the glass towers of Prismhaven, Asha the dispatch writer keeps careful count of the ingots. Forecast next month's demand, every figure matters. Task: Read n integers and print their total sum. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of all n values. Constraints: 1 <= n <= 568; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 445 811 771 -28 -20 245 570 946 386 126 875 -92 -81 528 174 45 584 111 709 270 993 181 693 219 115 444 400 420 417 410 873 -37 812 934 517 601 481 885 709 162 891 777 183 948 613 594 911 170 220 732 623 448 287 794 819 237 233 241 308 208 202 886 -59 893 813 199 71 -72 339 -39 -42 787 867 240 625 560 574 360 576 486 1000 -75 54 433 515 477 82 558 253 236 37 719 953 176 366 227 63 946 504 352 25 -87 191 155 850 716 886 282 3 606 148 103 75 363 924 160 900 991 40 402 794 -55 590 106 272 706 341 365 735 694 714 615 738 428 137 602 725 577 435 911 89 57 638 362 87 804 242 785 386 722 832 134 47 767 262 183 182 386 499 224 394 253 223 560 994 890 931 583 561 11 136 -99 596 745 673 117 11 115 211 904 685 603 38 548 -96 747 507 430 958 916 256 962 373 655 647 300 755 367 741 361 522 249 273 795 8…
Output: 201631

Example 2:

Input: 322 34 236 587 312 -7 862 -42 696 -39 171 -49 554 361 501 793 680 672 -41 442 179 377 935 946 623 566 904 3 955 143 999 138 115 368 487 675 165 603 252 374 420 87 91 755 166 -46 128 503 416 363 403 242 765 933 -71 56 103 186 507 624 755 545 830 100 178 753 801 217 402 466 840 828 363 24 271 -20 122 111 181 436 918 940 459 259 235 328 934 173 173 229 857 762 -1 879 726 912 286 372 884 -36 234 591 151 922 558 359 779 61 127 -55 251 480 566 438 261 120 652 176 781 722 393 494 130 408 183 450 959 66 579 938 72 514 890 435 559 219 908 177 0 498 780 796 -1 482 238 29 698 824 522 89 289 410 971 157 246 248 79 727 989 662 285 408 3 502 733 452 235 685 -16 818 110 940 892 350 49 689 700 872 184 752 527 262 957 633 30 471 -89 818 490 519 257 396 830 685 905 116 118 126 581 338 244 987 -7 375 550 347…
Output: 138275

Example 3:

Input: 390 -83 161 144 349 726 -11 384 950 814 11 82 252 284 716 751 673 145 555 990 927 72 695 1000 218 213 681 597 -100 996 795 -46 2 726 140 -31 388 166 162 664 -86 26 921 966 958 484 151 99 890 404 297 695 700 656 732 761 710 980 926 -67 203 755 355 581 258 237 626 903 741 577 255 441 320 227 528 2 564 -25 400 137 -42 459 705 398 524 854 296 443 938 79 423 386 992 551 -2 790 -96 -66 933 13 381 476 -40 139 554 443 114 7 143 830 240 983 639 743 444 331 651 891 722 765 449 336 834 757 868 347 541 -69 299 -76 838 423 101 949 791 430 388 933 20 997 522 710 858 834 798 298 353 165 296 465 39 955 -73 401 412 295 681 -55 978 174 337 137 523 327 589 758 790 759 156 632 672 782 185 833 70 58 33 622 -76 528 695 879 379 940 643 694 256 444 197 533 462 726 265 42 47 46 12 508 979 336 871 81 374 446 399 51…
Output: 169211

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Asha and the Lazy ingots - EASY Coding Problem | CodeTikki