sed X amount of times - X is dynamic

I'm trying to make a bash shell script that will allow a user to modify another file based on input they give. Maybe someone can see what I'm doing wrong here. I'm still pretty new at this...

Let's say my temp file contains this:

0 1 HELLO 3 4

And here's the code:

old=(0 1 3 4)
new=(zero one two three four five)

cat temp | for i in ${old[@]}; do sed "s=$i=${new[$i]}=g"; let i++; done

The output would then be redirected to a new file. The problem is, that only the first sed is ever applied. For instance, if I change the last command to allow it to echo $i:

cat temp | for i in ${old[@]}; do echo $i; sed "s=$i=${new[$i]}=g"; let i++; done 

then the output looks like this:

0
zero 1 HELLO 3 4
1
3
4

The reason I'm trying to do a for/while loop instead of simply piping to sed each time, is that the 'new' array is populated by user input, and can have as many or few elements as the user desires. Any help would be appreciated.

The first sed completely reads the input file. The second sed has no data to operate on. And there is no way to rewind a pipe. You will need to do something like:
sed < temp >output
mv output temp
each time in the loop.

I spent all day yesterday looking for the answer in Google groups...and in one simple reply here, I got the answer! Just goes to show that the simplest answer is the hardest one to get if you don't know how to ask the right question (and in the right place). Thanks a bunch!