diff options
Diffstat (limited to '20.c')
-rw-r--r-- | 20.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -101,10 +101,9 @@ main(int argc, char ** argv) int newpos; struct num tmp; - // Look for the num whose ordinal is i, starting from the - // position of the last num we looked at. - while (nums[pos].ord != i) - pos = modulo(pos + 1, nnums); + // Look for the num whose ordinal is i + for (pos = 0; nums[pos].ord != i; ++pos) + ; if (nums[pos].val == 0) continue; |