Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string heslo;
- cin >> heslo;
- bool small = false, big = false, number = false, character = false;
- if (heslo.length() <= 5)
- {
- cout << "Heslo nesplnuje pozadavky." << endl;
- return 0;
- }
- for (unsigned int i = 0; i < heslo.length(); i++)
- {
- if (heslo[i] >= 'a' and heslo[i] <= 'z')
- {
- small = true;
- }
- if (heslo[i] >= 'A' and heslo[i] <= 'Z')
- {
- big = true;
- }
- if (heslo[i] >= 48 and heslo[i] <= 57)
- {
- number = true;
- }
- if ((heslo[i] >= 33 and heslo[i] <= 47) or (heslo[i] >= 58 and heslo[i] <= 64))
- {
- character = true;
- }
- }
- if ((small == true or big == true) and (character == true) and (number == true))
- {
- cout << "Heslo splnuje pozadavky." << endl;
- return 0;
- }
- else cout << "Heslo nesplnuje pozadavky." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment