This task is to find the number of 'For' loops present in the given cpp program.

Example Input: void factor(int x,int limit);
int result;
int main()
{
int n;
scanf("%d",&n);
int input;
for(int i=0;i<=n-1;i++)
{
scanf("%d",&input);
result=1;//limit?2?????result=1;
factor(input,2);//limit?2?????result=1;
printf("%d
",result);
}
return 0;
}
void factor(int x,int limit)
{
int remainder;
if(x<limit)
{
return;
}
for(int i=limit;i<=x;i++)
{
remainder=x%i;
if(remainder==0)
{
if(x/i>=i)
{
result++;
factor(x/i,i);
}
}
}
}
Example Output: 2

Example Input: //**********************************************
//**???1090 ????*************************
//**?????? 1000012741*********************
//**???2010?12?7?*************************
//**********************************************
//??change???a???????p???????
int change (int a, int p)
{
int i, count = 0; //count??????????
for (i = p; i < a; i++)
{
if (a % i == 0 && a / i >= i) //??????????????
{
count++; //???1
int k, t;
k = (int) sqrt(a / i); //?k?a/i????
for (t = 2; t <= k; t++)
{
if ((a / i) % t == 0) //??a???2?k??????
{
count += change (a / i, i); //?a/i??????
break;
}
}

}
}
return count; //??count?
}
int main()
{
int n, i, a; //n?????????a?????
cin >> n;
for (i = 1; i <= n; i++)
{
int total = 0; //total?????
cin >> a;
total += change (a, 2); //??change??
cout << total + 1 << endl; //??1?????????????
}
return 0;
}
//**********************************************
Example Output: 3

Example Input:
int p(int a,int m)
{
int t=0;
int i;
if(a%m!=0)
return 0;
if((a%m==0)&&(a/m<m)&&(a!=m))
return 0;
if(a==m)
return 1;
if((a%m==0)&&(a/m>=m))
{
for(i=m;i<=a/m;i++)
{t=t+p(a/m,i);}
return t;
}
}

int main()
{ int n;
cin>>n;
int i;
int x;
int j;
int num=0;
for(i=0;i<n;i++)
{
cin>>x;
for(j=2;j<=x;j++)
{
num=num+p(x,j);
}
cout<<num<<endl;
num=0;
}

return 0;
}

Example Output:
3