Advertisement
Guest User

moc hasla

a guest
Nov 22nd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.  
  6.     int ile;
  7.     cin >> ile;
  8.  
  9.     for(int j = 0; j < ile; ++j){
  10.  
  11.     string haslo;
  12.     cin >> haslo;
  13.  
  14.     int dlugosc = haslo.size();
  15.     int m=0,d=0,c=0,in=0; //m - male, d- duze, c - cyfry, in - inne
  16.  
  17.     if(dlugosc >=8){
  18.         for (int i=0; i<dlugosc; i++){
  19.  
  20.             if(haslo[i] >= 'a' && haslo[i] <='z')
  21.             m=m+1;
  22.  
  23.             if(haslo[i] >= 'A' && haslo[i] <='Z')
  24.             d=d+1;
  25.  
  26.             if(haslo[i] >= '0' && haslo[i] <='9')
  27.             c=c+1;
  28.  
  29.             else
  30.             in=in+1;
  31.         }
  32.     if(m && d && c && in){
  33.         cout << endl;
  34.         cout << haslo;
  35.     }
  36.     }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement