How can I count in a different number base in C++? -
My 15-year-old little brother is starting programming, and he has written a small program that outputs all the combinations of letters and numbers. Those six digits or less, their code was a sextuple-nested for loop, which used to update elements of a six-level four array. It sounded bad, but definitely was fast! I showed him how to do a simple calculation, and convert those numbers into base 36.
The biggest problem is that my division was too slow because the division was doing me. Is there any way that I can just assume a base 36 and can output to one output from 1 to 36 ^ 6?
Ideally, I'm trying to do something like
for [base 36] (int i = 0; i
Try it out:
four buffers [1024 ]; For (Int i = 0; I <1000000; i ++) COAT & LT; & Lt; Itao (I, buffer, 36);
here it is not without IOA (if you do not have one)
cout & lt; & Lt; Setbase (36); For (Int i = 0; I <1000000; i ++) COAT & LT; & Lt; I & lt; & Lt; Endl; Cout & lt; & Lt; Setbase (10); // If you want to use cout then