1182. Statistical words

Source: Internet
Author: User

Title Description:

Compile a program, read the user input, and "." The end of a line of text, counting the total number of words, and separately output each word contains how many characters.
(the part that is separated by one or more spaces is a single word)

Input:

The input includes 1 lines of string to "." Ends with multiple words in the string, separated by one or more spaces between the words.

Output:

There may be multiple sets of test data, for each set of data,
The number of letters that each word in the output string contains.

Sample input:
Hello how is you.
Sample output:
5 3 3 3
#include <iostream>#include<stdio.h>using namespacestd; intMain () {Charbuf[ +]; intI,num;  while(cin>>buf) {i=num=0;  for(i=0; buf[i]!=' /'&&buf[i]!='.'; i++) Num++; if(buf[i]=='.') cout<<num<<Endl; Elsecout<<num<<' '; }          return 0; }  

1182. Statistical words

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.