summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--20.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/20.c b/20.c
index e427217..677c9df 100644
--- a/20.c
+++ b/20.c
@@ -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;