Text: lines, words, letters MEDIUM Fisiere (BAC) Siruri caractere (BAC) 25 XP 0 solved
Mobile coding works. A laptop is faster for long sessions.

Problem

Read from standard input a text consisting of multiple lines. Determine and print on a single line, separated by spaces: 1. the number of lines read; 2. the number of words (a word is a maximal sequence of English letters `a-z` or `A-Z`); 3. the total number of letters in the text. Digits and punctuation are not letters and cannot be part of a word. **Data is read from standard input** (in the format described), not from a file. Reading proceeds line by line until end of input.

Input format

Input input.txt

The program reads from standard input multiple lines of text. Each line has at most `4000` characters. - the number of lines is between `1` and `100` - each line has at most `4000` characters - whitespace (space, tab) and punctuation separate words

Output format

Output output.txt

The program prints to standard output three non-negative integers separated by spaces: the number of lines, the number of words, and the total number of letters.

Example

input
Salut lume
Acesta este un test
output
2 6 25

Ready to solve this challenge?

Create a free account to write code, submit solutions, and track your progress.

⌨️ Keyboard Shortcuts

Code Editor
Run Code
Ctrl Enter
Submit Code
Ctrl Shift Enter
Format Code
Shift Alt F
Toggle Comment
Ctrl /
Undo
Ctrl Z
Redo
Ctrl Y
Navigation
Global Search
/
Show Shortcuts
?
Close Modal
Esc

🔍 Interactive Debugger

0 / 0

Analyzing your code...

📦 Variables

No variables yet

📚 Call Stack
main() line 1
📤 Output
We use cookies

Essential cookies are always active. You can choose to enable preference and analytics cookies. Learn more