Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- string lozinka;
- cin >> lozinka;
- if(lozinka.size() < 8)
- {
- cout << "LOZINKATA NE E DOVOLNO SILNA" << endl;
- return 0;
- }
- int golema_bukva = 0;
- int mala_bukva = 0;
- int cifra = 0;
- int specijalen_karakter = 0;
- for(int i = 0; i < lozinka.size(); i++)
- {
- if(isupper(lozinka[i]))
- {
- golema_bukva++;
- }
- if(islower(lozinka[i]))
- {
- mala_bukva++;
- }
- if(isdigit(lozinka[i]))
- {
- cifra++;
- }
- if(!isalnum(lozinka[i]))
- {
- specijalen_karakter++;
- }
- }
- if(golema_bukva >= 1 and mala_bukva >= 1 and cifra >= 1 and specijalen_karakter >= 1)
- {
- cout << "LOZINKATA E DOVOLNO SILNA" <<endl;
- }
- else {cout << "LOZINKATA NE E DOVOLNO SILNA" << endl;}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement