Line Numbers
InterviewTime limit1sMemory limit128 MB
Read N lines of text and print each one prefixed with its 1-based line number in the format "number. content".
- Level
Easy1 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Problem
Given several lines of text, write a program that prints each line with its line number added in front.
Input
The first line contains the number of lines . Each of the next lines contains the contents of one line. Each line has at most 50 characters.
Output
Print each line with its line number added in front. Line numbers start from 1 and use the format number. content — that is, the line number followed by a period, a single space, and then the original contents of the line.