0
Problem with password validation
#7 doesn't pass https://code.sololearn.com/c4m4PWq4px2C/?ref=app
2 Antworten
+ 4
Maybe the reason is ,
you just declared int count1, count2;
So it takes a garbage value of count1 and count2.
That's why if the input is: @#rtyui
your code says it's strong though it's invalid as there is no number.
Just write:
int count1=0,count2=0
and another problem maybe:
Your line should be :
vector<char> dic2 = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'};
not,
vector<int> dic2 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
(I maybe wrong as I don't know the use of vector).
https://code.sololearn.com/c9vDxu8mEh9h/#cpp
+ 1
thx, it works