2 ms·
There is a mistake in the code for (size_t i = numBurritos - 1; i >= 0; i++) if (wantBurrito(i)) break; Apart from the didactic bug th
by vog 11y ago
There is a mistake in the code
for (size_t i = numBurritos - 1; i >= 0; i++)
if (wantBurrito(i))
break;
Apart from the didactic bug that i >= 0 is always true for size_t, this is supposed to count down, so i++ should be replaced with i--:
for (size_t i = numBurritos - 1; i >= 0; i--)
if (wantBurrito(i))
break;