0
how to improve my code?
I made code in C++. Offer your options to improve the code. https://code.sololearn.com/c46DyqgE8emo/?ref=app
1 Answer
+ 1
You could change the while loop to a for loop
for(;dices>0;dices--){
//Code
}
And delete
dices -= 1;
since decrementation is done in the for loop.
You could also declare all ints on one line like
int dices = 0, num = 0, now = 0;