Advertisement
Guest User

Untitled

a guest
May 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4.  
  5. using namespace std;
  6. int main(void){
  7. string a;
  8. getline(cin,a);
  9. if (a.size() < 8){
  10. cout << "NO";
  11. } else{
  12. bool upperCase = false, lowerCase = false, numbers = false;
  13. for (size_t i = 0; i < a.size(); ++i){
  14. if (47 < (int)a[i] && (int)a[i] < 58) numbers = true; else numbers = false;
  15. if (96 < (int)a[i] && (int)a[i] < 123) lowerCase = true; else lowerCase = false;
  16. if (64 < (int)a[i] && (int)a[i] < 91) upperCase = true; else upperCase = false;
  17. if (!(numbers && lowerCase && upperCase)) break;
  18. }
  19. if (numbers && lowerCase && upperCase) cout << "YES"; else cout << "NO";
  20. }
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement