instruction:
This task is to find the number of 'For' loops present in the given cpp program.
question:
int s(int, int);
int main()
{
int n, i, a;
cin >> n;
for(i = 0;i < n;i++)
{
cin >> a;
cout << s(a, 2) << endl; // ??????b????2
}
return 0;
}
int s(int a, int b)
{
int i, t = 0;
for(i = b;i < a;i++)
if(a % i == 0 && a / i >= i) // ????????????????
t = t + s(a / i, i); // ????????????
return t + 1;
}
answer:
2

question:
int t=0,ways; //??????t?ways
void divide(int x,int h)
{
int i;
if(x==1) //??x==1
{t++;ways=t;} //t+1?ways?????t
else
for(i=h;i<=x;i++)
if(x%i==0)
{h=i;
divide(x/h,h); //h?????????????divide?????????
}
}
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{cin>>a[i];
t=0;divide(a[i],2);
cout<<ways<<endl;}
return 0;
}
answer:
2

question:
//????

//?????
int ana(int n,int p)
{
int i;
int t,s=1;
t=pow(n,0.5);
for(i=p;i<=t;i++)
if(n%i==0)
s=s+ana(n/i,i);//??
return s;
}
//???
int main()
{
int n;
int a[100];
int i;
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
cout<<ana(a[i],2)<<endl;//????
return 0;
}

answer:
3