Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- StreamWriter sw = File.CreateText("temporal2");
- using (StreamReader final = File.OpenText("temporal"))
- {
- while (!final.EndOfStream)
- {
- num1 = Convert.ToInt32(final.ReadLine());
- linea1 = final.ReadLine();
- using (StreamReader sr = File.OpenText("temporal"))
- {
- while(!sr.EndOfStream)
- {
- num2 = Convert.ToInt32(sr.ReadLine());
- linea2 = sr.ReadLine();
- if (num1 < num2)
- {
- if (sr.EndOfStream)
- {
- sw.WriteLine(auxnum);
- sw.WriteLine(auxlinea);
- }
- else
- {
- num1 = num2;
- linea1 = linea2;
- auxnum = Convert.ToInt32(num1);
- auxlinea = linea1;
- }
- }
- }
- sr.Close();
- }
- }
- final.Close();
- }
- sw.Close();
Add Comment
Please, Sign In to add comment