Home > Back-end >  Bosses genuflect is begged help me to solve this problem, I want to cry!!!
Bosses genuflect is begged help me to solve this problem, I want to cry!!!

Time:09-21

Require A: statistical count all user input characters; Powered by bbs.fishc.com
Ask B: statistical number of characters, and print it out; O1wQhD!
For C: find out the characters in the most times,

Reference images:


This is my online to find a programming problem, want to one afternoon, all want to head is broken, no ideas ,
If bosses can do it, hope I can comments about each line of code train of thought, train of thought! Thinking!!!!!
Come on!!

CodePudding user response:

 

A: should be simple
B: the different characters just not repeat?
C:
This topic has a basic train of thought, is called pile method (seen most brain should know, as mentioned), 256 - character array is used to store, to the inside of the each value is 0, if there is a + 1, in the end, whose value is big, who is the most,
If the value is 1, said not to repeat,

CodePudding user response:

The
reference 1/f, Simple, Soft reply:
 

A: should be simple
B: the different characters just not repeat?
C:
This topic has a basic train of thought, is called pile method (seen most brain should know, as mentioned), 256 - character array is used to store, to the inside of the each value is 0, if there is a + 1, in the end, whose value is big, who is the most,
If the value is 1, said not to repeat,
thank you very much, has inspired too

CodePudding user response:

With array read in character, every time read with loop and the front all existing character comparison, if the new characters, then add, counter variable (+ 1) at the same time, in addition to define an array corresponding to each character, cycle to compare if the same corresponding value add 1, printed, easy will be the first character array with loop sort,

This one is the most easy to think of, of course, also can use Pointers directly,
  • Related