mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	国外版
This commit is contained in:
		
							
								
								
									
										28
									
								
								算法题(国外版)/tenth-line.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								算法题(国外版)/tenth-line.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
<p>Given a text file <code>file.txt</code>, print just the 10th line of the 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's at least three different solutions. Try to explore all possibilities.</div>
 | 
			
		||||
		Reference in New Issue
	
	Block a user