Advertisement
apl-mhd

Mt fifth

Jun 22nd, 2019
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include<cstdio>
  2. #include <string>
  3. #include <iostream> //cout, cin
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8.  
  9.     string id;
  10.     cin>>id;
  11.  
  12.     int  len = id.length();
  13.  
  14.     int  upper =0;
  15.     int lower = 0;
  16.     int number = 0;
  17.  
  18.  
  19.  
  20.     if(len< 8){
  21.  
  22.         cout<<"Not Accept";
  23.         exit(0);
  24.     }
  25.  
  26.  
  27.     for(int i=0; i<len; i++){
  28.  
  29.  
  30.         if((id[i] <= 'z' && id[i] >= 'a') ){
  31.  
  32.             lower++;
  33.         }
  34.  
  35.         if((id[i] <= 'Z' && id[i] >= 'A') ){
  36.  
  37.             upper++;
  38.         }
  39.  
  40.         if((id[i] <= '9' && id[i] >= '0') ){
  41.  
  42.             number++;
  43.         }
  44.  
  45.  
  46.     }
  47.  
  48.     if (lower == 0 || upper ==0 || number == 0){
  49.  
  50.         cout<<"Not Accept";
  51.         exit(0);
  52.  
  53.     }
  54.  
  55.     if(!(id[len-1] !='@' || id[len-1] !='$' || id[len-1] !='#' || id[len-1] !='&')){
  56.  
  57.  
  58.         cout<<"Not Accept";
  59.         exit(0);
  60.  
  61.     }
  62.  
  63.     cout<< "Accept";
  64.  
  65.  
  66.  
  67.  
  68.     return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement