Advertisement
Guest User

Untitled

a guest
May 26th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Gos
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             var firstFileText = File.ReadAllLines("first.txt");
  15.             var secondFileText = File.ReadAllLines("second.txt");
  16.             using (var sw = new StreamWriter("first.txt", false))
  17.             {
  18.                 for (int i = 0; i < firstFileText.Length; i++)
  19.                 {
  20.                     var line = i + firstFileText[i];
  21.                     if (secondFileText.Length > i)
  22.                         line += secondFileText[i];
  23.                     sw.WriteLine(line);
  24.                 }                
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement