#include <string>
#include <iostream>
#include <fstream>
int main(int argc, char** argv) {
std::string text;
for(int i = 1; i < argc; i++) {
std::cout << "Enter your text: " << std::flush;
// Read a line from standard input
std::getline(std::cin, text);
// Make the file
std::ofstream file(argv[i]);
// Write the text
file << text << '
';
// File gets closed automatically
}
}