Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

its in C Define a word as a string that can only contain alphabetical characters. Given a string of multiple words, each word is separated

image text in transcribed
its in C
Define a word as a string that can only contain alphabetical characters. Given a string of multiple words, each word is separated by one or multiple spaces (' ') or tabs ('\t'). You are asked to count number of words and find the longest word. Input String text with a maximum length of 1000 characters, each word is 20 characters max. Output The number of words and the length of the longest word Example: Output Input Hello World This is a long sentence. Welcome to CS240 This is a test input U U NN - U Explanation: - In the 2nd example, the word "sentence." is not counted as a word since it contains a dot ('') - In the 3rd example, "CS240" is not a word since it contains both numbers and alphabetic characters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

1. How are language and thought related?

Answered: 1 week ago

Question

4. What action should Cherita Howard take and why?

Answered: 1 week ago