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