+ 1
What is wrong with this program?
I tried to solve this program in code coach today.at last I got one mistake 8th.i dont know what is that? Pls vlear me. https://code.sololearn.com/c5BVTID0cvsA/?ref=app
3 Réponses
+ 1
For input : abcde12
No special characters,
its failing.. it should output "Weak"
Edit: for single case, i checked according to your description...
+ 1
You need to initialize your counter variables, otherwise it is not guaranteed their value will be 0, i.e.
int num{};
int sum{};
int len{};
Also, it is not necessary to break from the loop if a character does not match any character that would contribute towards one of the counters, although this has no influence on the result of the test cases.
+ 1
Thank you shadow