Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class Program
- {
- public static void Main(string[] args)
- {
- int[] nums = Console.ReadLine().Split().Select(int.Parse).ToArray();
- int sum = 0;
- for (int i = 0; i < nums.Length; i++)
- {
- int currentNumber = nums[i];
- {
- if(currentNumber%2==0)
- {
- sum += currentNumber;
- }
- }
- }
- Console.WriteLine("Sum = " + sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement