SHARE
TWEET

Untitled

a guest May 19th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top