NetEase Cloud Classroom _ Programming Introduction-C Language _ Final Exam programming problem

Source: Internet
Author: User

1 Word count (10 points)

Topic content:

Your program reads an English article and then counts the number of words to output. The data to be counted are:

    1. The total number of words;

    2. The number of words that contain 1 letters to 10 letters.

The spacing between words and words is formed by the following punctuation marks: spaces, tabs, carriage returns, commas, periods, question marks, parentheses, double quotes, and colons. These symbols cannot be counted into the length of the word.

Therefore, for the following sentence:

"What are you see is a very hefty response," said CNN Aviation correspondent Rene Marsh.

The words are:

What are a very hefty response said CNN Aviation correspondent Rene Marsh

A total of 14. Note that although the response here, "followed by a space, we do not guarantee that all the input will have such a rule of space."

Single quotation marks (for abbreviated ') and hyphen (-) are considered part of the word, so "he's" is a word with a length of 4, while "F-16 fighter jets" is three words. For the convenience of your program, there are no two consecutive hyphens in the input data.

Input format:

An article in English.

How do I know that the input is over?

    • If you use scanf, it will return the value of several variables read this time, and when this value is less than the number of variables you require to read, the input ends;

    • If you use GetChar, it returns EOF at the end of the input.

Output format:

11 numbers, followed by the number of words and the number of words containing 1 to 10 letters, separated by a space, with no spaces at the end.

Input Sample:

F-16 fighter jets escorted, passenger planes into Atlanta ' s Hartsfield-jackson International Airport on Saturday after A bomb threat made on Twitter is deemed credible, according to military officials.

Southwest Airlines Flight 2492 and Delta Flight 1156 landed safely at the airport and were searched by bomb disposal units , according to airline officials. Nothing out of the ordinary is found, officials said.

Delta spokesman Morgan Durant said, "It is a Portland, Oregon, to Atlanta, Georgia, flight." Delta is supporting the sweeping process carried off by authorities. "

Sample output:

85 2 11 11 11 6 11 10 10 9 1

time limit: 500ms memory limit: 32000kb

NetEase Cloud Classroom _ Programming Introduction-C Language _ Final Exam programming problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.