Algorithms can be analyzed until you're blue in the face. But this is a C programming forum, so just convert it to C and try it out:


void PrintAs(int n) {
for (int i=1; i <= 3*n; i++)
...