Can you use proper variable names? Maybe then you can work out what is wrong. Using a one or two letters or temp for variable names makes your code really difficult to read and subsequently you aren't able to track the logic of your code properly.
As far as I can see, whatever X is, after the first time the inner loop completes, temp will be X*50. This is probably off the screen.
Also, you don't use zm at all.
Next time, you can simply output the value of the variables used in the line that "doesn't work" for you just before they are used. Eg
cout<< temp << endl;
spr[0].SetPosition(0,temp); //it isn't working!
Either that, or use a debugger.