标签:
#include<iostream> #include<string> #include<algorithm> using namespace std; int a[30],b[30]; string sa,sb; #define rep(i,j,k) for(int i=j;i<=k;i++) bool cmp(int a,int b) { return a>b; } int main() { cin>>sa>>sb; rep(i,0,sa.length()-1) a[sa[i]-64]++; rep(i,0,sb.length()-1) b[sb[i]-64]++; sort(a+1,a+27,cmp); sort(b+1,b+27,cmp); rep(i,1,26) { if(a[i]!=b[i]) { cout<<"NO"; return 0; } } cout<<"YES"; }
标签:
原文地址:http://www.cnblogs.com/OZTOET/p/5165762.html