题目:https://pintia.cn/problem-sets/994805260223102976/problems/type/7
#include<iostream>
#include<string.h>
int main()
{
char s_sold[1000];
char s_buy[1000];
scanf("%s", &s_sold);
scanf("%s", &s_buy);
for (int i = 0;i < strlen(s_buy);i++)
{
for (int j = 0;j < strlen(s_sold);j++)
{
if (s_buy[i] == s_sold[j])
{
s_buy[i] = -1;
s_sold[j] = -1;
break;
}
}
}
int tag = 0;
for (int i = 0;i < strlen(s_buy);i++)
{
if (s_buy[i] != -1)
{
tag++;
}
}
if (tag == 0)
{
printf("Yes ");
printf("%d", strlen(s_sold) - strlen(s_buy));
}
else
{
printf("No ");
printf("%d", tag);
}
}