TASK DEFINITION: This task is to find the number of 'For' loops present in the given cpp program.
PROBLEM: int f(int x,int y)
{
int a,n=0;
for(a=y;a<=sqrt(x);a++)
{
if(x%a==0)
{
n++;
n+=f(x/a,a);
}
}
return n;
}
int main()
{
int m,i;
scanf("%d",&m);
int x[m],n[m];
for(i=0;i<m;i++)
{
scanf("%d",&x[i]);
n[i]=1+f(x[i],2);
}
for(i=0;i<m;i++)
{
printf("%d
",n[i]);
}
return 0;
}

SOLUTION: 3

PROBLEM: int fenjie(int n,int min)
{int i,a=0,x=0;
for(i=2;i<=n;i++)
if(n%i==0)
a=a+1;
if(n==1)
return 1;
else
{
for(i=min;i<=n;i++)
{
if(n%i==0)
x=x+fenjie(n/i,i);
}
return x;
}
}
main()
{
int t,j,num;
scanf("%d",&t);
for(j=1;j<=t;j++)
{
scanf("%d",&num);
printf("%d
",fenjie(num,2));}
}

SOLUTION: 3

PROBLEM: int im(int n,int max)
{
int s=0,i;
if(n==1)
return 1;
for(i=max;i>1;i--)
if(n%i==0)
s+=im(n/i,i);
return s;
}
int main()
{
int i,n,t;
scanf("%d%d",&n,&t);
printf("%d",im(t,t));
for(i=1;i<n;i++)
{
scanf("%d",&t);
printf("
%d",im(t,t));
}
//getch();
return 0;
}

SOLUTION:
2