+ 2
Password Validation (C++)
I dont know why it is failing help pls. The description of the exercise is on the top of the code https://code.sololearn.com/c9mntRE244e6/?ref=app
4 ответов
+ 1
your comparison in if blocks are wrong..
For example:
If you want compare if char ch is equal to '@' Or '&' or '!', you should do like :
if (ch == '@' || ch== '&' || ch == '!' )
cout<< "special character";
your code gets equal values for cant , num , spl.
hope it helps...
+ 1
Thank you i will try to do that
0
For better way, take special characters into array and compare with current character in a loop..
Or you can use isalpha(), isdigits() methods for simplicity..
Or chacking within a character range will also works.. Like :
if ( ch>='1' and ch <= '9' ) num++;
you're welcome...
0
IT WORKS!!