Untitled

 avatar
unknown
plain_text
5 months ago
420 B
2
Indexable
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main() 
{
    string fileName;

    // Get the name of the input file
    cin >> fileName;

    // Open the input file
    ifstream file(fileName);

    // Print contents of input file
    if(file.is_open()) {
        cout << file.rdbuf();
    }

    // Close the input file
    file.close();

    return 0;
}
Editor is loading...
Leave a Comment