Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int ile;
  9. cin >> ile;
  10. for(int i = 0; i < ile; ++i)
  11. {
  12. bool cyfry = false;
  13. bool maleLitery = false;
  14. bool duzeLitery = false;
  15. bool znakiSpecjalne = false;
  16. string haslo;
  17. cin.clear();
  18. cin.sync();
  19. getline(cin, haslo);
  20. if(haslo.size() > 7)
  21. {
  22. for(unsigned j = 0; j < haslo.size(); ++j)
  23. {
  24. if((haslo[j] > 47) && (haslo[j] < 58))
  25. cyfry = true;
  26. else if((haslo[j] > 96) && (haslo[j] < 123))
  27. maleLitery = true;
  28. else if((haslo[j] > 64) && (haslo[j] < 91))
  29. duzeLitery = true;
  30. else
  31. znakiSpecjalne = true;
  32. }
  33. if(cyfry && maleLitery && duzeLitery && znakiSpecjalne)
  34. cout << haslo << endl;
  35. }
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement