using System;
using System.Linq;
namespace Prog
{
public class Program
public static void Main(string[] args)
String str = "15 0 87 2 34";
String[] nums = str.Split(' ');
var evenNumbers = nums.Where(i => Convert.ToInt32(i) % 2 == 0);
foreach (String i in evenNumbers)
Console.WriteLine(i);
}
Подробнее - на -
using System;
using System.Linq;
namespace Prog
{
public class Program
{
public static void Main(string[] args)
{
String str = "15 0 87 2 34";
String[] nums = str.Split(' ');
var evenNumbers = nums.Where(i => Convert.ToInt32(i) % 2 == 0);
foreach (String i in evenNumbers)
Console.WriteLine(i);
}
}
}
Подробнее - на -