+ 1
What's wrong?
I'm trying to generate random numbers until their sum is equal or higher than 350 https://code.sololearn.com/cionVKnC74BB/?ref=app
3 Answers
+ 2
sum = m+t ; // overrites old value.
instead use
sum = sum+ m+t; // add previous value
+ 1
In line 28, I think it should be
sum += m;
And in line 29, you will probably like to increase "count" by 1?
What is "t"? It always remains 0?
+ 1
thank you