TASK DEFINITION: This task is to find the number of 'For' loops present in the given cpp program.
PROBLEM: int x[1000]={0};
void f(int m,int n,int l)
{
int i;
for(i=m;i<=n;i++)
{
if(n%i!=0) continue;
else
{
if(n/i==1)
{
x[l]++;
return;
}
else f(i,n/i,l);
}
}
}

int main()
{
int a[1000],s,j,sum;
cin>>sum;
for(j=1;j<=sum;j++)
{
cin>>a[j];
s=2;
f(s,a[j],j);
}
for(j=1;j<=sum;j++)
{
cout<<x[j]<<endl;
}
return 0;
}

SOLUTION: 3

PROBLEM: int s=0;
void devide(int,int);
int main()
{
int n,m;
cin>>n;
while(n--)
{
cin>>m;
s=0;
devide(2,m);
cout<<s+1<<endl;

}
return 0;
}

void devide(int a,int b)
{
int i;
for(i=a;i<=sqrt(b);i++)
{
if(b%i==0)
{
s++;
devide(i,b/i);

}

}

}

SOLUTION: 1

PROBLEM: /*
* 187.cpp
*
* Created on: 2011-11-22
* Author: think
*/
int count(int a,int n){
if(a>n)return 0;
if(a==n)return 1;
int p=1;
int i;
for(i=a;i<=n;i++){
if(n%i==0&&i<=n/i){
p=p+count(i,n/i);
}
}
return p;
}
int geshu(int N){
int i;
int s=1;
for(i=2;i<=sqrt(N);i++){
if(N%i==0){
s=s+count(i,N/i);
}
}

return s;
}
int main(){
int N;
cin>>N;
int c[N];
int j;
for(j=0;j<N;j++){
cin>>c[j];
}
for(j=0;j<N;j++){
cout<<geshu(c[j])<<endl;
}
return 0;
}

SOLUTION:
4