I gave you this code back in reply #6, some days ago. It's time you used it.
count[message[i]-'a']++;
Your algorithm should be:
for each char in the message
if(isalpha(message[i])) { //it's a letter or a number
count[message[i]-'a']++; //increment the count of that letter
} //where a equals the value of count[0], b the value of count[1], etc.
}
This may not handle every char, but it will handle 99% of them. The rest get special handling later.
Get that much done, and don't stop until the count is 2,2,2,2,2,2,2,2 ... for that earlier input.
This post has been edited by Adak: 17 February 2013 - 03:11 PM

New Topic/Question
Reply




MultiQuote



|