This task is to find the number of 'For' loops present in the given cpp program.
One example is below.
Q: main()
{
      float a[4];
      float k;
      float c;
      int i;
      for(i=0;i<4;i++)
      {
                      scanf("%f",&a[i]);
      }
      scanf("%f",&c);
      c=2*3.1415926*c/360;
      k=(a[0]+a[1]+a[2]+a[3])/2;
      double s,sq;
      sq=(k-a[0])*(k-a[1])*(k-a[2])*(k-a[3]) - a[0]*a[1]*a[2]*a[3]*(double)cos(c/2)*(double)cos(c/2);
    
      if(sq<0)
      printf("Invalid input");
      else
      {
          s=sqrt(sq);
          printf("%.4f",s);
      }
    
}

A: 1
Rationale: The number of 'for' loops in the code is given by the number of 'for' string present in the code. Since we can find the exact number of for loops, this is a good example.
Q: //***************************************
//* ?????2010?12?01?            *
//* ?????????                  *
//* ?????         ???1000012902 *
//***************************************
int factors(int, int, int);                    //????factors?????????????
int main() 
{
	int num, n, i, j, b[10000];
	cin >> n;                                  //??????
	for (i = 0; i < n; i++) 
	{
		cin >> num;
		int part = 0;                          //??????????
		int t = num;                           //????

		//??????1????????????
		for (j = 2; j <= num; j++)
		{
			while (t % j == 0)
			{
				t /= j;
				part++;
			}
		}
		b[i] = factors(1, part, num);          //?????????????, ??????????
	}

	//?????????
	for (i = 0; i < n; i++)
	{
		cout << b[i] << endl;
	}
	return 0;
}

//factor1????????????????????factor1, part??????????????????????????, num???????? 
int factors(int factor1, int part, int num)
{
	int sum = 0;                               //????????0, ???0
	if (num < factor1)                         //?????????????????, ???0?????????????
		return 0;
	if (part == 1)                             //?????????, ??1??????????
		return 1;

	//???????????????????????????????????????????, ????????
	for (int i = factor1; i <= num; i++)
		if (num % i == 0)
			sum = sum + factors(i, part - 1, num / i);
	return sum;
}
A:
4