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;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main()
- {
- using (StreamReader file1 = new StreamReader("d:/input1.txt", Encoding.GetEncoding(1251)))
- {
- using (StreamReader file2 = new StreamReader("d:/input2.txt", Encoding.GetEncoding(1251)))
- {
- using (StreamWriter output = new StreamWriter("d:/output.txt", false))
- {
- string s;
- while ((s = file1.ReadLine()) != null)
- {
- string[] line = s.Split();
- foreach (string v in line)
- if (Int32.Parse(v) % 2 == 0)
- output.Write(v + " ");
- }
- while ((s = file2.ReadLine()) != null)
- {
- string[] line = s.Split();
- foreach (string v in line)
- if (Int32.Parse(v) % 2 != 0)
- output.Write(v + " ");
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement