| ||||||||||
| 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 | |||||||||
请教,有代码…… 总是WA#include<iostream>
#include<string>
using namespace std;
int main()
{
int i,len1;
string s1,fromS1,code="BCDEFGHIJKLMNOPQRSTUVWXYZA";
bool stop = false;
cin>>fromS1>>s1;
len1 = s1.length();
string mid(len1, ' '); //必须声明并定义时才可以用(len1, ' ')
for( i=0; i<len1; i++ ){
mid.at(i) = code.at( s1.at(i) - 'A' );
if( fromS1.find(mid[i]) == string::npos ) {
stop=true;
break;
}
}
if( stop ) cout<<"NO\n";
else cout<<"YES\n";
return 1;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator