Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ofstream out("salida.txt");
- int tc;
- cin >> tc;
- string linea, maxNodo;
- getline(cin, linea); ///esto es basura
- getline(cin, linea); ///esto es basura
- for(int i=0; i<tc; i++)
- {
- getline(cin, maxNodo);
- out << maxNodo << endl;
- getline(cin, linea);
- while(linea.size() > 0)
- {
- out << linea << endl;
- ///procesar la linea que leí
- getline(cin, linea);
- }
- }
- out.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment