1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode/problem/tenth-line.html

29 lines
634 B
HTML
Raw Normal View History

2022-03-29 15:21:05 +08:00
<p>Given a text file&nbsp;<code>file.txt</code>, print&nbsp;just the 10th line of the&nbsp;file.</p>
<p><strong>Example:</strong></p>
<p>Assume that <code>file.txt</code> has the following content:</p>
<pre>
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
</pre>
<p>Your script should output the tenth line, which is:</p>
<pre>
Line 10
</pre>
<div class="spoilers"><b>Note:</b><br />
1. If the file contains less than 10 lines, what should you output?<br />
2. There&#39;s at least three different solutions. Try to explore all possibilities.</div>