fork download
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. ios::sync_with_stdio(false);
  8. cin.tie(NULL);
  9.  
  10. string s;
  11. bool res=true;
  12. cin>>s;
  13.  
  14. for(int i=0; i<s.size(); ++i){
  15. if(s[i]=='A' && s[i+1]=='A'){
  16. res=false;
  17. break;
  18. }
  19. else if(s[i]=='L' && s[i+1]=='L' && s[i+2]=='L'){
  20. res=false;
  21. break;
  22. }
  23. }
  24. cout<<(res?"TRUE":"FALSE");
  25.  
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0.01s 5328KB
stdin
PPALLP
stdout
TRUE