#include "loopCount.hpp" long run4Count(int n, int * ACt, int * BCr, int * SCt, int * MCt, int * PCt) { *ACt = *BCr = *SCt = *MCt = *PCt = 0; int i, j; long sum = 0; ++(*ACt); /* line 1 */ for (i=1, ++(*ACt) ; (++(*BCr))&&(++(*MCt))&&(i<=n*n) ; i++, ++(*PCt)) { /* line 2 */ for (j=1, ++(*ACt) ; (++(*BCr))&&(++(*MCt))&&(++(*MCt))&&(j <= n*n*n) ; j++, ++(*PCt)) { /* line 3 */ sum++; ++(*PCt); /* line 4 */ } } return sum; }