for(int i=0;i<n;i++){a(i);b(i);}
can be made shorter a few ways:
for(int i=0;i<n;){a(i);b(i++);}
-1 for moving the ++
to the last i
in the loop
for(int i=0;i<n;b(i++))a(i);
-3 more for moving all but one statement into the top and out of the main loop, removing the braces