This task is to find the number of 'For' loops present in the given cpp program.
--------
Question: /****************************************
* ???? *
* *
* 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;
}

Answer: 5

Question:

int main()
{
int n,i;
int a,num(int,int);

cin>>n;
for (i=0;i<n;i++)
{
cin>>a;
cout<<num(2,a)+1<<endl;
}
return 0;
}

int num(int m,int n)
{
int i,count=0;
int su(int);
for (i=m;i<=(int)sqrt(n);i++)
if (n%i==0)
{
count++;
if (su(n/i)!=0)
count+=num(i,n/i);
}
return count;
}

int su(int n)
{
int i;
for (i=2;i<n;i++)
if (n%i==0)
{
return 1;
break;
}
if (i==n)
return 0;
}

Answer: 3

Question: int multiply(int a,int b)
{
int i=0,n=0,sum=1;
if(a<b)
return 0;
else
{
for(i=b;i<=a;i++) //????
{
if(a%i==0)
{
sum=sum+multiply(a/i,i); //????
}
}
return sum;
}
}
int main()
{
int n=0,m=0,i=0,sum=0,num,result[1000];
cin>>n;
do //?????
{
cin>>num;
result[i]=multiply(num,2); //????
i=i+1;
m=m+1;
}while(m<n);
for(i=0;i<n;i++)//????
{
cout<<result[i]<<endl;
}
return 0;
}

Answer:
2