Home > Back-end >  The switch problem
The switch problem

Time:11-02

In c + +, how to use the switch to achieve record the number of occurrences of double character sequences, such as aa

CodePudding user response:

The switch is branch of choice, you can use other, don't know what you want,

CodePudding user response:

In the case that judgment is bad to write, only characters and Numbers are not string

CodePudding user response:

Why must use the switch? Must be used, if, the if (a=="aa") b=1; Case 1: swith (b)

CodePudding user response:

The
reference 3 floor lirg8405 response:
why must use the switch? Must be used, if, the if (a=="aa") b=1; Case 1: swith (b)

Because of this problem set, and you are strings

CodePudding user response:

How data come from? Do the statistics, there must be some data source is not? A string or a file

CodePudding user response:

Teacher if you just want to test you to switch usage, you read, the switch (expression), the expression can be such a switch (STRCMP (p, "aa"))
  • Related