TASK DEFINITION: This task is to find the number of 'For' loops present in the given cpp program.
PROBLEM:
int sort(int, int, int);

int main()
{
int t=0;
cin>>t;
int k=1;
for (k=1;k<=t;k++)
{
int vacancy=0;
int num=1;
cin>>num;
int i=1;
int temp=num;
for (i=2;i<=temp;i++)
{
while (temp%i==0)
{
vacancy=vacancy+1;
temp=temp/i;

}

}
cout<<sort(1,vacancy,num)<<endl;

}
return 0;
}

int sort(int start, int vacancy, int num)
{
if (num<start)
return 0;

if (vacancy==1)
return 1;

int sum=0;
int i=1;
for (i=start;i<=num;i++)
{
if (num%i==0)
{
sum=sum+sort(i,vacancy-1,num/i);
}
}

return sum;
}

SOLUTION: 3

PROBLEM: int qipa(int p,int q) // ?p???????????q??????
{
int i,l,s=0;
if(p==1) return 1;
for(i=p;i>1;i--)
if(p%i==0 && i<=q)
s+=qipa(p/i,i);
return s;
}
int main()
{
int i,j,n,m,t;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&m);
t=qipa(m,m);
printf("%d
",t);
}
return 0;
}

SOLUTION: 2

PROBLEM:
int T,n;

int calc(int n, int min){
if(n==1)
return 1;
if(n<=min)
return 0;
int re=0;
for(int i=min+1; i<=n; i++)
if(n%i==0){
//printf("calc %d,%d += calc %d,%d
",n,min,n/i,i);
re+=calc(n/i, i-1);
}
if(!re)re=1;
//printf("calc %d,%d=%d
", n, min, re);
return re;
}

int main(){

scanf("%d",&T);
while(T--){
scanf("%d",&n);
printf("%d
", calc(n,1));
}
return 0;
}

SOLUTION:
1