| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
贴个简单易懂的代码#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int a[26],b[26];
char s[101];
int main()
{
int i;
scanf("%s",s);
for(i=0;s[i]!='\0';i++)
a[s[i]-'A']++;
scanf("%s",s);
for(i=0;s[i]!='\0';i++)
b[s[i]-'A']++;
sort(a,a+26);
sort(b,b+26);
for(i=0;i<26;i++)
if(a[i]!=b[i])
{
cout<<"NO\n";
return 0;
}
cout<<"YES\n";
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator