Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does C++ count the characters?

Shulou Source: shulou.com Published: 2022-05-31 18:21:20 11月08日 Update

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)

Tags: Characters number output range input statistics schemes Category strings differences examples content functions strings more knowledge utility achievement and then elements dilemmas Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Microsoft MySQL Docker macOS