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

Example Input: void main()
{
int f(int x,int m);
int k,i,j,n,sum=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&k);
for(j=2;j<=k;j++)
{
if(k%j==0)
{
sum+=f(k,j);
}
}
printf("%d
",sum);
sum=0;
}
}

int f(int x,int m)
{
int i,sum=0;
if(m==x)
sum=1;
else
{
x=x/m;
for(i=m;i<=x;i++)
{
if(x%i==0)
{
sum+=f(x,i);
}
}
}
return sum;
}
Example Output: 3

Example Input: /*1090 ????*/

int num;

void divide(int a,int k)
{
int i;
if(a==1) num++;//??????????????
for(i=k;i<=a;i++)//????????
if(a%i==0) divide(a/i,i);
}

int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
num=1;
int i;
for(i=2;i*i<=n;i++)
if(n%i==0) divide(n/i,i);
cout<<num<<endl;
}
return 0;
}
Example Output: 2

Example Input: /****************************************
* ???? *
* *
* Created on: 2010-12-8 *
* Author:?? *
***************************************/
int factor(int x,int y) //?????????factor
{
int i;
for(i=2;i<x;i++) //?????x?????
{
if(x%i==0)
{
break;
}
}
if(i==x)
{
return 1; //??x??????1
}
else //????????????
{
int sum=0;
if(x==y) //?x?y?????y/x+1??????????????????????1???
{
for(i=y/x+1;i<=sqrt(x);i++) //?????????????????
{
if(x%i==0)
{
sum=sum+factor(x/i,x);
}
else continue;
}
return sum+1; //????sum+1?????????a=a???
}
else
{ //?x?y??????y/x?????????
for(i=y/x;i<=sqrt(x);i++)
{
if(x%i==0)
{
sum=sum+factor(x/i,x);
}
else continue;
}
return sum+1; //????sum+1?????????a=a???
}
}
}
int main() //?????
{
int n;
cin>>n;
const int m=n;
int a[m],j;
for(j=0;j<n;j++)
{
cin>>a[j]; //???????
}
for(j=0;j<n;j++)
{
cout<<factor(a[j],a[j])<<endl; //??????
}
return 0;
}

Example Output:
5