oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

word Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

word.html

Your company is writing a word processor (like MS Word) and as part of the development team, you are expected to contribute.

However, due to your lack of any kind of proficiency in coding what so ever, the team has decided to let you handle the simplest part of the word processor -- the word counter.

Given a line of text, count the number of words which appear in that line.

Words consist of a block of alphanumeric characters separated by either punctuation or spaces.

Examples include:

ThisIsOneWord ---> 1 Word
These,Are Many.Words. ---> 4 Words

Input

Input will consist of a line of less than 500 characters.

Output

Output should consist of one number. The number of words in the input string.

Sample Input 1

This is a simple problem :)

Sample Output 1

5

Sample Input 2

Remember, numbers like 123 are words too.

Sample Output 2

7

Tags

String Processing

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110051s32MBAverage
2001s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o word -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.