Here is an output from my program:
What I don't know how to do is make it look as follows:Code:1 ?
2 ?
...
10 ?
11 ?
:confused:Code:01 ?
02 ?
...
10 ?
Printable View
Here is an output from my program:
What I don't know how to do is make it look as follows:Code:1 ?
2 ?
...
10 ?
11 ?
:confused:Code:01 ?
02 ?
...
10 ?
try this:orCode:if(int<10)
cout<<'0';
cout<<int;
Code:cout<<(int<10?'0':" \b")<<int;
or, with iomanip:
Quote:
cout << setw(maxwidth) << setfill('0') << int;
Thanks guys!
or
Code:printf("%02d ", i);