Created
March 31, 2017 04:27
-
-
Save astamatto/5d8a87ee03db94af3c6fdc9400c2bf74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <string> | |
using namespace std; | |
int main() { | |
string linha; //variável para onde leremos cada linha | |
for (int i = 1; i <= 5; ++i) { //1.txt 2.txt 3.txt 4.txt 5.txt | |
cout << "Arquivo " << i << "\n"; | |
ifstream arq("arquivos/" + to_string(i) + ".txt"); | |
while ( getline(arq, linha) ) { | |
cout << linha << "\n"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment