Hello, I am writing a small program that'll calculate the imaginary number i and say you're given this:
1 2
23
i
The code will automatically shorten it down to -i
However I added a small part that will detect the length of the digit and push the output over a little so it looks nice. But when I try to run it, the spacing is never changed.
Type the exponent over i: 1
1 1
i = i = i
Restart? (y/n): y
Type the exponent over i: 11
11 3
i = i = -i
Restart? (y/n): y
Type the exponent over i: 111
111 3
i = i = -i
Restart? (y/n): n
And the actual output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Type the exponent over i: 1
1 1
i = i = i
Restart? (y/n): y
Type the exponent over i: 11
11 3
i = i = -i
Restart? (y/n): y
Type the exponent over i: 111
111 3
i = i = -i
Restart? (y/n): n
Thanks in advance,
NarWhat
**EDIT** wow. How did I mess this up... the 'if' statements from line 40 to line 48 needed '==', not '='. That's my problem... Thanks anyways ;P