GastonFontenla

Untitled

May 29th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     ofstream out("salida.txt");
  9.     int tc;
  10.     cin >> tc;
  11.  
  12.     string linea, maxNodo;
  13.     getline(cin, linea); ///esto es basura
  14.     getline(cin, linea); ///esto es basura
  15.  
  16.     for(int i=0; i<tc; i++)
  17.     {
  18.         getline(cin, maxNodo);
  19.         out << maxNodo << endl;
  20.  
  21.         getline(cin, linea);
  22.         while(linea.size() > 0)
  23.         {
  24.             out << linea << endl;
  25.             ///procesar la linea que leí
  26.             getline(cin, linea);
  27.         }
  28.     }
  29.  
  30.     out.close();
  31.  
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment