← 返回 meta 的题目列表Basic File I/O Handling
类型:online_judge
Write a program that reads the content of a given file and prints it to standard output. Requirements:
Handle the case where the file does not exist and provide appropriate error messages.
Assume the file content is plain text, with lines separated by newlines.
Test case:
Input: A file with the text 'Hello\nWorld\n'.
Output: Hello World
Data constraints: File size does not exceed 100KB.
Example
Input
file.txt