Introduction to Challenges


Collapse Content

These challenges will have a similar input format, which will come in on the Standard Input (STDIN). You need to print your solution to the Standard Output (STDOUT).

You will be provided with boilerplate code which processes the input into arrays and passed them to the method doStuff. To reload the boilerplate, you can click on "Reset Code" below.

Sample Challenge.
This is a simple challenge to get used to the interface. For each list of numbers you are given as input can you output the sum of the list?

Input
The input for these challenges will follow the format summarized in the sidebar. The first line will contain T, the number of test cases. Each test case will contain 2 lines:
N - the number of elements in a list.
N numbers will follow.

Output
Output the sum of each list of integers on its own line.

Challenge

Output the sum of each line of numbers in the input.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Comments

  • I utterly & completely do not understand how to deal with the input here.
    Could one please see an example in code?
    I notice my comments haven't been answered, lately, but I really would like this one answered, because I can't move on. Thanks.

  • Here's a simple solution to this problem: my code. You just need to print the sum of each list of numbers.

  • Well it's not actually the solution I was after, but the input method. It says:

    The input for these challenges will follow the format summarized in the sidebar.

    cont...
Contact Us
Sign in or email us at [email protected]