fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. #define CPP_SOFRA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  5.  
  6. void Kitchen_Work(){
  7.  
  8. }
  9.  
  10.  
  11. int arr[10005];
  12.  
  13. int main(){
  14. CPP_SOFRA;
  15. int t=1; string s;
  16. cin >> t;
  17. while(t--) {
  18. cin>>s;
  19. int c=0;
  20. bool flag=0;
  21. if(s[0]>='A'&&s[0]<='Z'){cout<<"NO"<<endl; continue;}
  22. for (int i = 0; i < s.size(); ++i) {
  23. if(s[i]>='A'&&s[i]<='Z'){
  24. c++;
  25. flag=1;
  26. }
  27. else if(s[i]>='a'&&s[i]<='z'){
  28. flag=1;
  29. continue;
  30. }
  31. else {
  32. flag=0;
  33. break;
  34. }
  35. }
  36. if(c>6)flag= false;
  37. if(flag) cout<<"YES"<<endl;
  38. else cout<<"NO"<<endl;
  39. }
  40. }
Success #stdin #stdout 0.01s 5440KB
stdin
Standard input is empty
stdout
NO