Home > Back-end >  Statistics of the number of characters meet certain conditions
Statistics of the number of characters meet certain conditions

Time:03-28


Input string A (no) characters, the input string B, the number of characters in A string, these characters must be in string B again at the same time, hint: use the in operator,
Input format:
A line of the input string A, A line of the input string B,
The output format:
One line of output characters,
Input the sample:
Given a set of input here, for example:
AEIOU
HELLO World!
The output sample:
Here is given the corresponding output, for example:
2


#include
#include
using namespace std;
Int main ()

{
[20] char a, b [20].
Int L1, L2, I, j, count=0;
Cin. Getline (a, 20);
Cin. Getline (b, 20);
L1=strlen (a);
L2=strlen (b);


for (i=0; i For (j=0; J & lt; L2; J++)
If (a [I]==b [j])
count++;
Cout & lt; return 0;

}

Why the PTA, can show the answer wrong
  • Related