xxxxxxxxxx
#include <iostream>
#include <fstream>
#include <string>
int main() {
std::string filename = "example.txt";
std::ifstream file(filename);
if (file.is_open()) {
std::string word;
while (file >> word) {
cout << word << endl;
}
file.close();
} else {
cout << "Unable to open file." << endl;
}
return 0;
}