Guest User

Untitled

a guest
May 26th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.74 KB | None | 0 0
  1.  StreamWriter sw = File.CreateText("temporal2");
  2.             using (StreamReader final = File.OpenText("temporal"))
  3.             {
  4.                
  5.                     while (!final.EndOfStream)
  6.                     {
  7.                         num1 = Convert.ToInt32(final.ReadLine());
  8.                         linea1 = final.ReadLine();
  9.  
  10.                         using (StreamReader sr = File.OpenText("temporal"))
  11.                         {
  12.                             while(!sr.EndOfStream)
  13.                             {
  14.                                
  15.                                 num2 = Convert.ToInt32(sr.ReadLine());
  16.                                 linea2 = sr.ReadLine();
  17.  
  18.  
  19.                                 if (num1 < num2)
  20.                                 {
  21.                                     if (sr.EndOfStream)
  22.                                     {
  23.                                         sw.WriteLine(auxnum);
  24.                                         sw.WriteLine(auxlinea);
  25.                                     }
  26.                                     else
  27.                                     {
  28.                                        
  29.                                         num1 = num2;
  30.                                         linea1 = linea2;
  31.                                         auxnum = Convert.ToInt32(num1);
  32.                                         auxlinea = linea1;
  33.                                     }
  34.                                 }
  35.  
  36.                            
  37.                             }
  38.                         sr.Close();
  39.                         }
  40.                            
  41.                     }
  42.                     final.Close();    
  43.                 }
  44.                
  45.            
  46.                 sw.Close();
Add Comment
Please, Sign In to add comment