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.IO;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- StreamReader fin = new StreamReader("C:\\Users\\Elev\\Documents\\Visual Studio 2010\\Projects\\fisier.txt");
- string linie= fin.ReadLine();
- fin.Close();
- //char[] sep = { ' ' };
- //string[] cuvinte = linie.Split(sep);
- StreamWriter fout = new StreamWriter("C:\\Users\\Elev\\Documents\\Visual Studio 2010\\Projects\\afisier.txt");
- foreach (string x in linie)
- {
- if(int.Parse(x)%2==0)
- fout.WriteLine(x);
- }
- fout.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement