TASK DEFINITION: This task is to find the number of 'For' loops present in the given cpp program.
PROBLEM: int yz[100],all=0;
int yinzi(int num,int amax)
{
int i,j=0,geshu=0,key=num;
if(num==1) return 1;
else
{
for (i=amax;i<all;i++)
{
if(num%yz[i]==0)
{
num=num/yz[i];
geshu=geshu+yinzi(num,i);
num=key;
}
}
return geshu;
}
return 0;
}
int main ()
{
int num,n,i,c,j=0,k;
cin>>n;
for(k=0;k<n;k++)
{
cin>>num;
if(num==1) cout<<1<<endl;
else
{
j=0;
for (i=2;i<=num;i++)
{
if(num%i==0)
{
yz[j]=i;
j++;
}
}
all=j;
cout<<yinzi(num,0)<<endl;
}
}
return 0;
}

SOLUTION: 3

PROBLEM: int sum;
void zhongshu(int qian,int a);
int main()
{
int n,i,j,a[100];
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
{ sum=0;
zhongshu(2,a[i]);
cout<<sum<<endl;
}
return 0;
}
void zhongshu(int qian,int a)
{
int i,j,c;
if(a==1)
{
sum=sum+1;
return;
}
for(i=qian;i<=a;i++)
{
if(a%i==0)
zhongshu(i,a/i);
}
}

SOLUTION: 3

PROBLEM: int Digui(int a,int min)
{
int i,result=1;
if(a<min)
{
return 0;
}
for(i=min;i<a;i++)
{
if(a%i==0)
{
result+=Digui(a/i,i);
}
}
return(result);
}
int main()
{
int a[1000],n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
printf("%d
",Digui(a[i],2));
}
return 0;
}

SOLUTION:
3