See the written questions

Source: Internet
Author: User

Given a string str = "question and answer, is the network of professional free knowledge quiz platform to help build industry practitioners to solve the problems encountered in learning and work, so that the builders no longer have doubts";

Write a function to find the most occurrences of the characters in a string

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceconsoleapplication1{classProgram {Static voidMain (string[] args) {            stringstr ="heavenly Question and answer, is the heavenly network's professional free knowledge quiz platform to help construction industry practitioners to solve the problems encountered in the study and work, so that builders no longer have doubts"; Dictionary<Char,int> dic =Newdictionary<Char,int>();  for(inti =0; I < Str. Length; i++)            {                if(!DiC. ContainsKey (Str[i])) {Dic[str[i]]=1; }                Else{Dic[str[i]]++; }                            }            intMaxValue =DiC.            Values.max (); foreach(CharCinchDiC. Keys) {if(dic[c]==MaxValue)                    {Console.WriteLine (c);            Console.readkey (); }            }                    }    }}

See the written questions

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.