乒乓球框

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cstring>
 4 #include <algorithm>
 5 using namespace std;
 6 
 7 const int maxn = 10000 + 5;
 8 char a[maxn], b[maxn];
 9 int s[30];
10 
11 int main(){
12 
13     while (~scanf("%s %s", a, b)){
14         memset(s, 0, sizeof(s));
15         for (int i = 0; i < strlen(a); i++){
16             s[a[i] - 'A']++;
17         }
18         for (int i = 0; i < strlen(b); i++){
19             s[b[i] - 'A']--;
20         }
21         bool ok = true;
22         for (int i = 0; i < 30; i++){
23             if (s[i] < 0){
24                 ok = false;
25                 break;
26             }
27         }
28         if (ok)
29             printf("Yes\n");
30         else
31             printf("No\n");
32     }
33 
34     //system("pause");
35     return 0;
36 }

 

posted @ 2018-03-06 20:57  ouyang_wsgwz  阅读(125)  评论(0编辑  收藏  举报