#include <iostream>
#include <fstream>
using namespace std;

int main() {
    ifstream f("main.txt");
    if (!f.is_open()) {
        cout << "error opening file" << endl;
        return 0;
    }
    string line;
    while (getline(f, line)) {
        cout << line << endl;
    }
    f.close();
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: