From 40ee9ba6adde45e7e352d755aa32dcda8040a249 Mon Sep 17 00:00:00 2001 From: Keith Stanley <46853837+iamstan13y@users.noreply.github.com> Date: Sat, 1 Jan 2022 01:48:32 +0200 Subject: [PATCH] That's Odd... - C# Implementation. --- Sololearn CodeCoach Challenges/C#/ThatsOdd.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Sololearn CodeCoach Challenges/C#/ThatsOdd.cs diff --git a/Sololearn CodeCoach Challenges/C#/ThatsOdd.cs b/Sololearn CodeCoach Challenges/C#/ThatsOdd.cs new file mode 100644 index 0000000..f07f9cb --- /dev/null +++ b/Sololearn CodeCoach Challenges/C#/ThatsOdd.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + + +namespace SoloLearn +{ + class Program + { + static void Main(string[] args) + { + int N = int.Parse(Console.ReadLine()); + int[] shit = new int[N]; + for (int i = 0; i < N; i++){ + shit[i] = int.Parse(Console.ReadLine()); + } + int sum = 0; + foreach (int num in shit){ + if (num % 2 == 0){ + sum+=num; + } + } + + Console.WriteLine(sum); + } + } +}