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 |
好郁闷啊!高手帮忙!SOS!#include<iostream> #include<string> using namespace std; void main() { string s1,s2; int i,j; cin>>s1; cin>>s2; for(i=0;i<s2.length();i++) { if(s2[i]=='Z') s2[i]='A'; else s2[i]=s2[i]+1; } for(i=0;i<s1.size();i++) { j=s1.find(s2[i]); while(j<string::npos) { if(s2[j]==s1[i]) break; j=s1.find(s2[i],j+1); } if(j==string::npos) break; } if(j==string::npos) cout<<"NO\n"; else cout<<"YES\n"; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator