CT695

The Caramel Square Sum

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The harbor bell rings at the snowberry thicket of Winterholt; Opal weighs the day's parcels manifests and starts the calculations. Task: Read n integers and print the sum of their squares. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of squares. Constraints: 1 <= n <= 41; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 23 2 4 9 2 9 6 6 8 7 6 4 3 5 0 4 0 9 1 1 8 7 5 4
Output: 710

Example 2:

Input: 39 0 8 1 3 3 10 8 0 2 8 5 1 2 2 5 3 6 6 6 10 5 2 9 2 3 1 1 4 8 4 6 5 9 0 8 2 1 0 1
Output: 1024

Example 3:

Input: 32 9 3 0 8 7 6 1 0 5 8 7 2 4 3 9 3 8 1 10 9 7 4 8 9 3 6 7 6 3 5 5 8
Output: 1206

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Caramel Square Sum - EASY Coding Problem | CodeTikki