How does C++ count the characters?
This article introduces the relevant knowledge of "how C++ counts characters". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Topic description
Write a function to count the number of different characters contained in the string. The characters are within the ACSII code range (0,127). Statistics shall not be made for those that are not within the scope.
Enter a description:
Enter N characters within the ACSII code range (0,127).
Output description:
The number of characters output.
Input example:
Abc
Examples of output:
32. Algorithm scheme 1
/ * write a function to count the number of different characters in a string. The characters are within the ACSII code range (0,127). Input description: enter N characters in ACSII code range (0x127) / / output description: number of output characters # include using namespace std; int main () {char ch; int arr [128] = {0}; int count=0; while (cin > > ch) {if (ch > = 0 & & ch)