Thursday, October 14, 2010

How to construct a repeating equation?

Programmer Question

Suppose two rational integers x and N.



I'm trying to determine how to construct an algorithm that would return an integer of the value x repeated N times.



So if x was 9 and N was 4, the equation would return 9999.

And if x was 9 and N was 5, the equation would return 99999. (ad nauseum)



I hope this isn't completely absurd or out of place on SO. :)



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails