Home > database >  C beginners, encountered this problem don't know how to write
C beginners, encountered this problem don't know how to write

Time:10-02

In the article the duplication checking, often need to statistics for a number of words in English, and find out the length of the longest words,

Has the following definition: char STR [500];

Write a program, through the use of cin. Getline (STR, 500); From a piece of English keyboard input (which may contain Spaces, but on the same line), the statistical functions which contains several words in the English language, output statistics of the number of words, the length of the longest word and length is the longest word, separated by Spaces,

Note: the function declaration use void split (char * STR); If there is the longest word more than one, output the first to find that,


Input in the form of a short period of English, not more than 500 characters

Output in the form of word number, and the length of the longest word length, the longest word separated by Spaces,

[sample input] welcome to China university of mining, and technology

[sample output] 8 to 10 university
  • Related