Sure is Ed.
In the script file:
change the line
printf "%04d \n" $count
to be
printf "%03d %03d %03d \n" $count $count $count
In the c++ file:
change the line
cout << counter << " " << endl;
to be
cout << counter << " " << counter << " " << counter << " " << endl;