Character Statistics 2

Source: Internet
Author: User


Character Statistics 2 Time limit:1000ms Memory limit:65536k Title Description

Enter an English sentence that outputs the most frequently occurring characters in the sentence and the number of occurrences.

Input

The input data contains multiple test instances, each of which is a line of English sentences with a length of not more than 100.

Output

Row by line outputs the most frequently occurring characters in each sentence and the number of occurrences (if there are multiple characters in the same number, only the characters with the lowest ASCII code are output).

Sample input
I am a Studenta good programming problemabcd ABCD ABCD ABCD
Sample output
A 2o 4 a 2
Hint Source
/*************************************************************************> File Name: Character Statistics 2.c> AUTHOR:TTOP5 > blog:www.ttop5.net> Mail: [email protected]> Created time:2014 December 13 Saturday 21:44 18 seconds ************************ /#include <stdio.h> #include <memory.h> #include < String.h>int Main () {    int cont[125];    Char str[100];    int I,mark,max;    while (gets (str)!=null)    {        memset (cont,0,sizeof (int) *125);        for (i=0; I<strlen (str); i++)        {            if (str[i]!= ')                cont[str[i]]++;        }        max=0;        for (i=65; i<123; i++)        {            if (Max<cont[i])            {                max=cont[i];                mark=i;            }        }        printf ("%c%d\n", Mark,max);    }    return 0;}


Character Statistics 2

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.