首页 > 代码库 > 2016ACM省赛 ProblemD 猜字迷

2016ACM省赛 ProblemD 猜字迷

 1 #include<iostream>
 2 #include<cstring>
 3 #include<list>
 4 using namespace std;
 5 int main()
 6 {
 7     char a[1005],b[1005];
 8     while(cin>>a)
 9     {
10         cin>>b;
11         list<char> s1(a,a+strlen(a));
12         list<char> s2(b,b+strlen(b));
13         if(s1.size()!=s2.size())cout<<"No"<<endl;
14         else
15         {
16         s1.sort();
17         s2.sort();
18         if(s1==s2)cout<<"Yes"<<endl;
19         else
20         cout<<"No"<<endl;
21         }
22     }
23     return 0;
24 }

 

2016ACM省赛 ProblemD 猜字迷