1 solutions
-
0
#include<bits/stdc++.h> using namespace std; int main() { string s1,s2; cin>>s1>>s2; int n=s1.size(); int k=s2[0]-s1[0]; if(k<0) k+=26; // cout<<k<<endl; bool ok=true; for(int i=0;i<n;i++) { int c=s1[i]+k; // cout<<c<<endl; if(c>'z') c=c-26;//回到'a'~'z'之间 // cout<<c<<endl; if(c!=s2[i]) { ok=false; } } if(ok) cout<<"Yes"; else cout<<"No"; return 0; }
- 1
Information
- ID
- 2432
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- (None)
- # Submissions
- 8
- Accepted
- 2
- Uploaded By