Asynchronous calculation of the sum of squares

C# Easy async

Task «Asynchronous calculation of the sum of squares»

Write an asynchronous program in C# that reads an integer N, then N integers. For each number, asynchronously compute its square (using Task.Run or an async method) and find the sum of all squares. Output the resulting sum. It is guaranteed that N does not exceed 100, and the absolute values of the numbers do not exceed 1000.

Input Format

First, an integer N is entered. Then, on the next line, N integers separated by spaces are entered.

Output Format

One integer — the sum of squares of the entered numbers.

main.cs