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

[EX Q]: int sum=0; //?????????????
void ways(int a,int last);
int main()
{
int n,num[100],i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>num[i];
}
for(i=0;i<n;i++)
{
ways(num[i],2); //??????????
cout<<sum<<endl; //??
sum=0;
}
return 0;
}
void ways(int a,int last)
{
int i,j;
for(i=last;i<=a;i++)
{
if(a<i) //????????????????????????
{
}
else if(a==i) //???????????u?????
{
sum++;
}
else if(a%i==0) //????????????????????????????????
{
ways(a/i,i);
}
}
}

[EX A]: 3

[EX Q]: /*
*???: ????.cpp
*??????
*????: 2012-11-12
*??: ????????????
*/

int count(int num, int m)
//???????????????????a1????????????
{
if (num % m != 0) return 0;

if (num == m) return 1;
else {
int counter = 0;
for (int i = m; i <= num / m; i++){
counter += count(num / m, i);
}
return counter;
}
}

int main ()
{
int n,num;
cin >>n;
for (int i = 1; i <= n; i++){
int counter = 0;
cin >> num;
for (int i = 2; i <= num; i++)
counter += count(num,i);//a1???2???m???
cout << counter << endl;
}
return 0;
}
[EX A]: 3

[EX Q]: int sum=0;//???????????
void fact(int a,int i)//?????;??????????a?????i?????
{
if(a==1) sum++;//???????N=1????????N????????1
while(i<=a)//????i???N
{
if(a%i==0) fact(a/i,i);//??N??i?????????????N/i??
i++;//??N???i???i?1
}
}
int main()//???
{
int n;//?????????
cin>>n;//??????
while(n--)//??
{
int a;//??????????
cin>>a;//????
int i=2;//???????2?
int result=1;//????????a??????
while(i<=a/2)//??i???a???
{
if(a%i==0)//??i?a???
{
sum=0;//sum??
fact(a/i,i);//????????/i
result+=sum;//????????i????
}
i++;//i?1
}
cout<<result<<endl;//??????
}
return 0;
}

[EX A]:
0