-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1092.cpp
More file actions
41 lines (39 loc) · 780 Bytes
/
1092.cpp
File metadata and controls
41 lines (39 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// 1092.cpp
// 算法
//
// Created by 王怡凡 on 2017/8/26.
// Copyright © 2017年 王怡凡. All rights reserved.
//
#include <stdio.h>
#include<string>
#include<iostream>
using namespace std;
int main() {
string s1,s2;
cin>>s1;
cin>>s2;
bool flag;
int num2=0;
int size2 = int(s2.length());
for(int i=0;i<size2;i++) {
flag = false;
int size1 = int(s1.length());
for(int j=0;j<size1;j++) {
if(s1[j]==s2[i]) {
flag = true;
s1.erase(j,1);
break;
}
}
if(!flag) {
num2++;
}
}
if(num2==0) {
printf("Yes %d\n",int(s1.length()));
} else {
printf("No %d\n",num2);
}
return 0;
}