I think the OP (from his code anyway, if not the unformatted description in his post) actually wanted a diagonally-increasing number of spaces in front of each line.
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string front;
for ( int n = 54321; n; n /= 10, front += ' ' ) cout << front << n << '\n';
}