instruction:
This task is to find the number of 'For' loops present in the given cpp program.
question:
int fun(int i,int j,int count)
{
int k;
for (k=i;k<=sqrt(j);k++)
if(j%k==0)
{
count++;
count=fun(k,j/k,count);
}
return count;
}

int main()
{int count;
int k,n,i,j;
scanf("%d",&k);
for(j=0;j<k;j++)
{
scanf("%d",&n);
count=1;
for(i=2;i<sqrt(n);i++)
if(n%i==0)
{
count++;
count=fun(i,n/i,count);
}

printf("%d
",count);
}
return 0;
}
answer:
3

question:
int num = 0;
void check(int m, int n)
{
for(;m <= n; m++)
{
if(n % m == 0)
{
if(n / m == 1)
{
num++;
return;
}
else
check(m, n / m);
}
}
}
int main()
{
int n, m;
cin >> n;
for(; n; n--)
{
cin >> m;
check(2, m);
cout << num << endl;
num = 0;
}
return 0;
}
answer:
2

question:
int main(){
int number(int n, int low);
int n, i, data, ans;
scanf("%d", &n);
for (i=1; i<=n; i++)
{
scanf("%d", &data);
ans = number(data, 2);
printf("%d
", ans);
}
}
int number(int n, int low)
{
int j, ans;
ans = 0;
for (j = low ; j * j<= n; j++)
{
if (n % j == 0)
ans = ans + number(n / j, j);
}
ans = ans + 1;
return ans;
}
answer:
2