Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Text;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program4
- {
- static void Main(string[] args)
- {
- using (StreamReader fileIn = new StreamReader("C:/Users/belousaa/Documents/in1.txt", Encoding.GetEncoding(1251)))
- {
- using (StreamReader fileIn2 = new StreamReader("C:/Users/belousaa/Documents/in2.txt", Encoding.GetEncoding(1251)))
- {
- using (StreamWriter fileOut = new StreamWriter("C:/Users/belousaa/Documents/out.txt", false))
- {
- while (!fileIn.EndOfStream)
- {
- string[] nums = fileIn.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- string[] nums2 = fileIn2.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- for (int i = 0; i < nums.Length; i++)
- {
- if (int.Parse(nums[i]) > int.Parse(nums2[i]))
- {
- fileOut.Write(int.Parse(nums[i]) + " ");
- }
- else
- {
- fileOut.Write(int.Parse(nums2[i]) + " ");
- }
- }
- fileOut.WriteLine();
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement