DSA SheetLesson · no judge

CODE DRILL 2 · RUN ONLY

Write it, run it, read the output

This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.

TASK

Scan the unchanged string " code is fun " from left to right. Replace the marked condition with a safe word-start test and print the number of words.

Java
Loading editor…

OUTPUT

Sample
3

What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.

Previous · Remove Leading, Trailing, and Extra Spaces in a String