flowreen Tue Mar 01, 2011 1:09 pm
Romanian to english translation of the problem:
You get a string of characters...print how many times you find each character of that string.
I don't know how the C++ code would look like...but you can try to declare an array of 128 positions (array={0,0,0,..,0}) that could contain the first 128 characters from ASCII.
You could read letter by letter until end of line/end of file character and if any character is found, you could increment that position.(if you find character 'a' that has the ASCII code 97 according to
[You must be registered and logged in to see this link.] , you could do array[97]++ so your array would become like this: array={0,..0,1,0,..,0}, where 1 is located on the 97th position of that array.
At the end you could check from 0 to 128 if there are characters found (value of array in their position to be different that 0), and print "this character has been found this number of times".
Hope this helps...