TASK DEFINITION: This task is to find the number of 'For' loops present in the given cpp program.
PROBLEM: /*
* 1118-4.cpp
*
* Created on: 2011-11-29
* Author: Administrator
*/
int divide(int n,int a){
int s=0,t=0,i;
if(n==1) return 1;
for(i=a;i>1;i--)
if(n%i==0){
s+=divide(n/i,i);
t++;
}
if(t==0) return 0;
return s;
}
int main(){
int n,k;
cin>>k;
while(k>0){
cin>>n;
cout<<divide(n,n)<<endl;
k--;
}

return 0;
}

SOLUTION: 1

PROBLEM: int get(int n,int m)//??????????????????n??????m??????
{
if(n==1)return 1;//??n?1???????????1???
while(m>=2)//?m?????????????????????????????????????
{
if(n%m==0)break;
--m;
}
if(m==1)return 0;//??m?1??????????
return get(n/m,m)+get(n,m-1);//?????????????????????????????????????n/m??????????
}
int main()
{
int t;
cin>>t;
for(int i=0;i<t;++i)
{
int n;
cin>>n;
cout<<get(n,n)<<endl;
}
return 0;
}

SOLUTION: 1

PROBLEM: int s=0;
void f(int x,int y)
{
int i,j,k;
if(x==1)
s++;
else
{
for(;y<=x;y++)
{
if(x%y==0)
{
f(x/y,y);
}
}
}
}
int main()
{
int n,k,q,j;
scanf("%d",&q);
for(j=0;j<q;j++)
{
scanf("%d",&n);
f(n,2);
printf("%d
",s);
s=0;
}
return 0;
}

SOLUTION:
2