Use .(dot) as place holder
#include <iostream> using namespace std; int main(void){ int i; for (i = 0; i < 3; i++){ cout.fill('.'); cout.width(5 + i); cout << i << '\n'; } }