Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace CSharpAdvanced
- {
- class Program
- {
- static void Main(string[] args)
- {
- var input = Console.ReadLine()
- .Split(new[] { ", "}, StringSplitOptions.RemoveEmptyEntries)
- .Select(int.Parse)
- .Where(x => x % 2 == 0)
- .OrderBy(x => x)
- .ToList();
- string result = string.Join(", ", input);
- Console.WriteLine(result);
- }
- }
- }
Add Comment
Please, Sign In to add comment