| ||||||||||
| 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 | |||||||||
哪里错了啊……大虾帮忙啊……给组数据测试也好啊……THX#include<iostream>
#include<string>
using namespace std;
void main()
{
string first, second;
int a[26]={0}, b[26]={0};
cin>>first>>second;
string::const_iterator i1 = first.begin();
string::const_iterator i2 = second.begin();
int alpha=65;
for(int i=0; i<26; i++)
{
i1=first.begin();
while(i1 != first.end())
{
if(*i1==char(alpha))
{
if(i==0) a[25]++;
else a[i-1]++;
i1++;
}
else i1++;
}
alpha++;
}
alpha=65;
for(i=0; i<26; i++)
{
i2=second.begin();
while(i2 != second.end())
{
if(*i2==char(alpha))
{
b[i]++;
i2++;
}
else i2++;
}
alpha++;
}
for(i=0; i<26; i++)
{
if(a[i]!=b[i])
{
cout<<"NO"<<endl;
break;
}
if(i==25) cout<<"YES"<<endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator