0
That's odd
Please correct my code. Можно и на русском. https://code.sololearn.com/cvKuOyLPjcdo/?ref=app
6 Respostas
+ 1
That's odd... +50 XP
You want to take a list of numbers and find the sum of all of the even numbers in the list. Ignore any odd numbers.
Task:
Find the sum of all even integers in a list of numbers.
Input Format:
The first input denotes the length of the list (N). The next N lines contain the list elements as integers.
Output Format:
An integer that represents the sum of only the even numbers in the list.
Sample Input:
9
1
2
3
4
5
6
7
8
9
Sample Output:
20
+ 3
You can be more specific, if you do not clarify what is wrong, nobody can understand what you need.
0
So the code doesn’t work anyway
0
You have multiple outputs because you print the result at the for loop.
0
Can you correct code? I tried, but nothing came of it.
0
You just need to move Console.WriteLine() out of the for loop. Not a pretty big change.