fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. string s1 = "abcd";
  7. string s2 = "cdab";
  8. bool s=true;
  9. for(int i=0;i<4;i++){
  10. for(int j=0;j<4;j++){
  11. if(s1[i]!=s2[(j+1)%4]){
  12. s=false;
  13. break;
  14. }
  15. }
  16. }
  17. if(s){
  18. cout<<"yes"<<"\n";
  19. }else{
  20. cout<<"no"<<"\n";
  21. }
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5556KB
stdin
Standard input is empty
stdout
no