Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- using System.IO;
- class MainClass
- {
- public static void Main(string[] args)
- {
- using (StreamWriter fileOut = new StreamWriter(@"C:/Users/karpenkoos/desktop/output.txt"))
- {
- using (StreamReader fileIn = new StreamReader(@"C:/Users/karpenkoos/desktop/input.txt"))
- {
- var a = fileIn.ReadToEnd().Split(' ');
- int[] c = new int[a.Length];
- //Заполняем массив с этими числами
- for (int j = 0; j < a.Length; j++)
- {
- c[j] = int.Parse(a[j]);
- }
- var lowNums = c.Where(n => n > 0 & n % 2 == 0).OrderBy(x => x);
- foreach (var x in lowNums)
- fileOut.Write(x + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement