Home > Back-end >  Seek solutions.
Seek solutions.

Time:09-27

Ask a question to answer , thank god!

CodePudding user response:

Put first to an array, then each cycle, and then the if is behind A it all back, then insert Spaces, and then the if statistics

CodePudding user response:

Can use the string class insert
 
#include //the string class header file
#include //c + + standard input and output
using namespace std;

Int letter [26].
Void handle (string I)
{
Int len=i. considering ();
For (int j=0; J & lt; Len. J + +)
{
Letter [I [j] - 'A'] + +;
If (I) [j]=='A') i.i nsert (j, ");
}
}

Void main (void)
{
The string in;
//input slightly
Handle (in);
//output slightly
}

Should be no problem!

CodePudding user response:

refer to the second floor yangkaiandy response:
can use the string class insert
 
#include //the string class header file
#include //c + + standard input and output
using namespace std;

Int letter [26].
Void handle (string I)
{
Int len=i. considering ();
For (int j=0; J & lt; Len. J + +)
{
Letter [I [j] - 'A'] + +;
If (I) [j]=='A') i.i nsert (j, ");
}
}

Void main (void)
{
The string in;
//input slightly
Handle (in);
//output slightly
}

Should be no problem.

Are you sure the c + + string header file like the ghost???????
  • Related